Changeset 51154 for trunk/src/wp-includes/class-wp-block-type-registry.php
- Timestamp:
- 06/15/2021 03:21:50 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-block-type-registry.php
r50419 r51154 53 53 54 54 if ( ! is_string( $name ) ) { 55 $message = __( 'Block type names must be strings.' ); 56 _doing_it_wrong( __METHOD__, $message, '5.0.0' ); 55 _doing_it_wrong( 56 __METHOD__, 57 __( 'Block type names must be strings.' ), 58 '5.0.0' 59 ); 57 60 return false; 58 61 } 59 62 60 63 if ( preg_match( '/[A-Z]+/', $name ) ) { 61 $message = __( 'Block type names must not contain uppercase characters.' ); 62 _doing_it_wrong( __METHOD__, $message, '5.0.0' ); 64 _doing_it_wrong( 65 __METHOD__, 66 __( 'Block type names must not contain uppercase characters.' ), 67 '5.0.0' 68 ); 63 69 return false; 64 70 } … … 66 72 $name_matcher = '/^[a-z0-9-]+\/[a-z0-9-]+$/'; 67 73 if ( ! preg_match( $name_matcher, $name ) ) { 68 $message = __( 'Block type names must contain a namespace prefix. Example: my-plugin/my-custom-block-type' ); 69 _doing_it_wrong( __METHOD__, $message, '5.0.0' ); 74 _doing_it_wrong( 75 __METHOD__, 76 __( 'Block type names must contain a namespace prefix. Example: my-plugin/my-custom-block-type' ), 77 '5.0.0' 78 ); 70 79 return false; 71 80 } 72 81 73 82 if ( $this->is_registered( $name ) ) { 74 /* translators: %s: Block name. */ 75 $message = sprintf( __( 'Block type "%s" is already registered.' ), $name ); 76 _doing_it_wrong( __METHOD__, $message, '5.0.0' ); 83 _doing_it_wrong( 84 __METHOD__, 85 /* translators: %s: Block name. */ 86 sprintf( __( 'Block type "%s" is already registered.' ), $name ), 87 '5.0.0' 88 ); 77 89 return false; 78 90 } … … 102 114 103 115 if ( ! $this->is_registered( $name ) ) { 104 /* translators: %s: Block name. */ 105 $message = sprintf( __( 'Block type "%s" is not registered.' ), $name ); 106 _doing_it_wrong( __METHOD__, $message, '5.0.0' ); 116 _doing_it_wrong( 117 __METHOD__, 118 /* translators: %s: Block name. */ 119 sprintf( __( 'Block type "%s" is not registered.' ), $name ), 120 '5.0.0' 121 ); 107 122 return false; 108 123 }
Note: See TracChangeset
for help on using the changeset viewer.