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
This commit is contained in:
Sergey Biryukov 2020-07-26 22:17:01 +00:00
parent aa22457754
commit 9f841ea7c3
3 changed files with 21 additions and 20 deletions

View File

@ -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.
* }

View File

@ -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 ) {

View File

@ -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.