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.

git-svn-id: https://develop.svn.wordpress.org/trunk@48629 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-07-26 22:15:20 +00:00
parent 01d58943a1
commit 10563ae9e7
2 changed files with 20 additions and 19 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 ) {