wp/wp-includes/class-wp-block-patterns-registry.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
--- a/wp/wp-includes/class-wp-block-patterns-registry.php	Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-includes/class-wp-block-patterns-registry.php	Wed Sep 21 18:19:35 2022 +0200
@@ -16,6 +16,7 @@
 	/**
 	 * Registered patterns array.
 	 *
+	 * @since 5.5.0
 	 * @var array
 	 */
 	private $registered_patterns = array();
@@ -23,6 +24,7 @@
 	/**
 	 * Container for the main instance of the class.
 	 *
+	 * @since 5.5.0
 	 * @var WP_Block_Patterns_Registry|null
 	 */
 	private static $instance = null;
@@ -39,17 +41,29 @@
 	 */
 	public function register( $pattern_name, $pattern_properties ) {
 		if ( ! isset( $pattern_name ) || ! is_string( $pattern_name ) ) {
-			_doing_it_wrong( __METHOD__, __( 'Pattern name must be a string.' ), '5.5.0' );
+			_doing_it_wrong(
+				__METHOD__,
+				__( 'Pattern name must be a string.' ),
+				'5.5.0'
+			);
 			return false;
 		}
 
 		if ( ! isset( $pattern_properties['title'] ) || ! is_string( $pattern_properties['title'] ) ) {
-			_doing_it_wrong( __METHOD__, __( 'Pattern title must be a string.' ), '5.5.0' );
+			_doing_it_wrong(
+				__METHOD__,
+				__( 'Pattern title must be a string.' ),
+				'5.5.0'
+			);
 			return false;
 		}
 
 		if ( ! isset( $pattern_properties['content'] ) || ! is_string( $pattern_properties['content'] ) ) {
-			_doing_it_wrong( __METHOD__, __( 'Pattern content must be a string.' ), '5.5.0' );
+			_doing_it_wrong(
+				__METHOD__,
+				__( 'Pattern content must be a string.' ),
+				'5.5.0'
+			);
 			return false;
 		}
 
@@ -71,9 +85,12 @@
 	 */
 	public function unregister( $pattern_name ) {
 		if ( ! $this->is_registered( $pattern_name ) ) {
-			/* translators: 1: Pattern name. */
-			$message = sprintf( __( 'Pattern "%1$s" not found.' ), $pattern_name );
-			_doing_it_wrong( __METHOD__, $message, '5.5.0' );
+			_doing_it_wrong(
+				__METHOD__,
+				/* translators: %s: Pattern name. */
+				sprintf( __( 'Pattern "%s" not found.' ), $pattern_name ),
+				'5.5.0'
+			);
 			return false;
 		}
 
@@ -158,7 +175,7 @@
  *
  * @since 5.5.0
  *
- * @param string $pattern_name       Pattern name including namespace.
+ * @param string $pattern_name Pattern name including namespace.
  * @return bool True if the pattern was unregistered with success and false otherwise.
  */
 function unregister_block_pattern( $pattern_name ) {