- 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-patterns-registry.php
r50532 r51154 42 42 public function register( $pattern_name, $pattern_properties ) { 43 43 if ( ! isset( $pattern_name ) || ! is_string( $pattern_name ) ) { 44 _doing_it_wrong( __METHOD__, __( 'Pattern name must be a string.' ), '5.5.0' ); 44 _doing_it_wrong( 45 __METHOD__, 46 __( 'Pattern name must be a string.' ), 47 '5.5.0' 48 ); 45 49 return false; 46 50 } 47 51 48 52 if ( ! isset( $pattern_properties['title'] ) || ! is_string( $pattern_properties['title'] ) ) { 49 _doing_it_wrong( __METHOD__, __( 'Pattern title must be a string.' ), '5.5.0' ); 53 _doing_it_wrong( 54 __METHOD__, 55 __( 'Pattern title must be a string.' ), 56 '5.5.0' 57 ); 50 58 return false; 51 59 } 52 60 53 61 if ( ! isset( $pattern_properties['content'] ) || ! is_string( $pattern_properties['content'] ) ) { 54 _doing_it_wrong( __METHOD__, __( 'Pattern content must be a string.' ), '5.5.0' ); 62 _doing_it_wrong( 63 __METHOD__, 64 __( 'Pattern content must be a string.' ), 65 '5.5.0' 66 ); 55 67 return false; 56 68 } … … 74 86 public function unregister( $pattern_name ) { 75 87 if ( ! $this->is_registered( $pattern_name ) ) { 76 /* translators: %s: Pattern name. */ 77 $message = sprintf( __( 'Pattern "%s" not found.' ), $pattern_name ); 78 _doing_it_wrong( __METHOD__, $message, '5.5.0' ); 88 _doing_it_wrong( 89 __METHOD__, 90 /* translators: %s: Pattern name. */ 91 sprintf( __( 'Pattern "%s" not found.' ), $pattern_name ), 92 '5.5.0' 93 ); 79 94 return false; 80 95 }
Note: See TracChangeset
for help on using the changeset viewer.