--- a/wp/wp-includes/class-wp-block-pattern-categories-registry.php Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-includes/class-wp-block-pattern-categories-registry.php Wed Sep 21 18:19:35 2022 +0200
@@ -14,6 +14,7 @@
/**
* Registered block pattern categories array.
*
+ * @since 5.5.0
* @var array
*/
private $registered_categories = array();
@@ -21,6 +22,7 @@
/**
* Container for the main instance of the class.
*
+ * @since 5.5.0
* @var WP_Block_Pattern_Categories_Registry|null
*/
private static $instance = null;
@@ -30,13 +32,17 @@
*
* @since 5.5.0
*
- * @param string $category_name Pattern category name.
+ * @param string $category_name Pattern category name including namespace.
* @param array $category_properties Array containing the properties of the category: label.
* @return bool True if the pattern was registered with success and false otherwise.
*/
public function register( $category_name, $category_properties ) {
if ( ! isset( $category_name ) || ! is_string( $category_name ) ) {
- _doing_it_wrong( __METHOD__, __( 'Block pattern category name must be a string.' ), '5.5.0' );
+ _doing_it_wrong(
+ __METHOD__,
+ __( 'Block pattern category name must be a string.' ),
+ '5.5.0'
+ );
return false;
}
@@ -53,14 +59,17 @@
*
* @since 5.5.0
*
- * @param string $category_name Pattern name including namespace.
+ * @param string $category_name Pattern category name including namespace.
* @return bool True if the pattern was unregistered with success and false otherwise.
*/
public function unregister( $category_name ) {
if ( ! $this->is_registered( $category_name ) ) {
- /* translators: 1: Block pattern name. */
- $message = sprintf( __( 'Block pattern category "%1$s" not found.' ), $category_name );
- _doing_it_wrong( __METHOD__, $message, '5.5.0' );
+ _doing_it_wrong(
+ __METHOD__,
+ /* translators: %s: Block pattern name. */
+ sprintf( __( 'Block pattern category "%s" not found.' ), $category_name ),
+ '5.5.0'
+ );
return false;
}
@@ -74,7 +83,7 @@
*
* @since 5.5.0
*
- * @param string $category_name Pattern category name.
+ * @param string $category_name Pattern category name including namespace.
* @return array Registered pattern properties.
*/
public function get_registered( $category_name ) {
@@ -101,7 +110,7 @@
*
* @since 5.5.0
*
- * @param string $category_name Pattern category name.
+ * @param string $category_name Pattern category name including namespace.
* @return bool True if the pattern category is registered, false otherwise.
*/
public function is_registered( $category_name ) {
@@ -131,7 +140,7 @@
*
* @since 5.5.0
*
- * @param string $category_name Pattern category name.
+ * @param string $category_name Pattern category name including namespace.
* @param array $category_properties Array containing the properties of the category.
* @return bool True if the pattern category was registered with success and false otherwise.
*/
@@ -144,7 +153,7 @@
*
* @since 5.5.0
*
- * @param string $category_name Pattern category name including namespace.
+ * @param string $category_name Pattern category name including namespace.
* @return bool True if the pattern category was unregistered with success and false otherwise.
*/
function unregister_block_pattern_category( $category_name ) {