Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/wp-includes/class-wp-block-type-registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public function register( $name, $args = array() ) {
if ( ! is_string( $name ) ) {
_doing_it_wrong(
__METHOD__,
__( 'Block type names must be strings.' ),
/* translators: %s: The received block type name type. */
sprintf( __( 'Block type names must be strings, received %s.' ), gettype( $name ) ),
'5.0.0'
);
return false;
Expand All @@ -64,7 +65,7 @@ public function register( $name, $args = array() ) {
if ( preg_match( '/[A-Z]+/', $name ) ) {
_doing_it_wrong(
__METHOD__,
__( 'Block type names must not contain uppercase characters.' ),
sprintf( __( 'Block type names must not contain uppercase characters. "%s" was given.' ), esc_html( $name ) ),
'5.0.0'
);
return false;
Expand All @@ -74,7 +75,8 @@ public function register( $name, $args = array() ) {
if ( ! preg_match( $name_matcher, $name ) ) {
_doing_it_wrong(
__METHOD__,
__( 'Block type names must contain a namespace prefix. Example: my-plugin/my-custom-block-type' ),
/* translators: %s: Block name. */
sprintf( __( 'Block type names must contain a namespace prefix. Example: my-plugin/my-custom-block-type. "%s" was given.' ), esc_html( $name ) ),
'5.0.0'
);
return false;
Expand Down
Loading