From 9f841ea7c30ce185db61e0ddc79ce5f643bab6bb Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 26 Jul 2020 22:17:01 +0000 Subject: [PATCH] Docs: Add a note that the `$args` parameter of `register_block_type()` accepts any public property of `WP_Block_Type`. Follow-up to [47754]. Props ediamin. See #48640. Built from https://develop.svn.wordpress.org/trunk@48629 git-svn-id: http://core.svn.wordpress.org/trunk@48391 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/blocks.php | 25 ++++++++++---------- wp-includes/class-wp-block-type-registry.php | 14 +++++------ wp-includes/version.php | 2 +- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/wp-includes/blocks.php b/wp-includes/blocks.php index a3fdd43888..dfe642ab82 100644 --- a/wp-includes/blocks.php +++ b/wp-includes/blocks.php @@ -12,12 +12,13 @@ * * @since 5.0.0 * - * @param string|WP_Block_Type $name Block type name including namespace, or alternatively a - * complete WP_Block_Type instance. In case a WP_Block_Type + * @param string|WP_Block_Type $name Block type name including namespace, or alternatively + * a complete WP_Block_Type instance. In case a WP_Block_Type * is provided, the $args parameter will be ignored. * @param array $args { - * Optional. Array of block type arguments. Any arguments may be defined, however the - * ones described below are supported by default. Default empty array. + * Optional. Array of block type arguments. Accepts any public property of `WP_Block_Type`. + * Any arguments may be defined, however the ones described below are supported by default. + * Default empty array. * * @type callable $render_callback Callback used to render blocks of this block type. * } @@ -32,8 +33,8 @@ function register_block_type( $name, $args = array() ) { * * @since 5.0.0 * - * @param string|WP_Block_Type $name Block type name including namespace, or alternatively a - * complete WP_Block_Type instance. + * @param string|WP_Block_Type $name Block type name including namespace, or alternatively + * a complete WP_Block_Type instance. * @return WP_Block_Type|false The unregistered block type on success, or false on failure. */ function unregister_block_type( $name ) { @@ -82,10 +83,9 @@ function generate_block_asset_handle( $block_name, $field_name ) { /** * Finds a script handle for the selected block metadata field. It detects - * when a path to file was provided and finds a corresponding - * asset file with details necessary to register the script under - * automatically generated handle name. It returns unprocessed script handle - * otherwise. + * when a path to file was provided and finds a corresponding asset file + * with details necessary to register the script under automatically + * generated handle name. It returns unprocessed script handle otherwise. * * @since 5.5.0 * @@ -170,8 +170,9 @@ function register_block_style_handle( $metadata, $field_name ) { * @param string $file_or_folder Path to the JSON file with metadata definition for * the block or path to the folder where the `block.json` file is located. * @param array $args { - * Optional. Array of block type arguments. Any arguments may be defined, however the - * ones described below are supported by default. Default empty array. + * Optional. Array of block type arguments. Accepts any public property of `WP_Block_Type`. + * Any arguments may be defined, however the ones described below are supported by default. + * Default empty array. * * @type callable $render_callback Callback used to render blocks of this block type. * } diff --git a/wp-includes/class-wp-block-type-registry.php b/wp-includes/class-wp-block-type-registry.php index 2cddfb07e8..e11cb9911a 100644 --- a/wp-includes/class-wp-block-type-registry.php +++ b/wp-includes/class-wp-block-type-registry.php @@ -34,16 +34,16 @@ final class WP_Block_Type_Registry { * * @since 5.0.0 * - * @param string|WP_Block_Type $name Block type name including namespace, or alternatively a - * complete WP_Block_Type instance. In case a WP_Block_Type + * @param string|WP_Block_Type $name Block type name including namespace, or alternatively + * a complete WP_Block_Type instance. In case a WP_Block_Type * is provided, the $args parameter will be ignored. * @param array $args { - * Optional. Array of block type arguments. Any arguments may be defined, however the - * ones described below are supported by default. Default empty array. + * Optional. Array of block type arguments. Accepts any public property of `WP_Block_Type`. + * Any arguments may be defined, however the ones described below are supported by default. + * Default empty array. * * @type callable $render_callback Callback used to render blocks of this block type. * @type array $attributes Block attributes mapping, property name to schema. - * Accepts any public property of `WP_Block_Type`. * } * @return WP_Block_Type|false The registered block type on success, or false on failure. */ @@ -94,8 +94,8 @@ final class WP_Block_Type_Registry { * * @since 5.0.0 * - * @param string|WP_Block_Type $name Block type name including namespace, or alternatively a - * complete WP_Block_Type instance. + * @param string|WP_Block_Type $name Block type name including namespace, or alternatively + * a complete WP_Block_Type instance. * @return WP_Block_Type|false The unregistered block type on success, or false on failure. */ public function unregister( $name ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 8bc2b5f7a0..d79cf3ca43 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-beta3-48628'; +$wp_version = '5.5-beta3-48629'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.