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:
parent
aa22457754
commit
9f841ea7c3
|
@ -12,12 +12,13 @@
|
||||||
*
|
*
|
||||||
* @since 5.0.0
|
* @since 5.0.0
|
||||||
*
|
*
|
||||||
* @param string|WP_Block_Type $name Block type name including namespace, or alternatively a
|
* @param string|WP_Block_Type $name Block type name including namespace, or alternatively
|
||||||
* complete WP_Block_Type instance. In case a WP_Block_Type
|
* a complete WP_Block_Type instance. In case a WP_Block_Type
|
||||||
* is provided, the $args parameter will be ignored.
|
* is provided, the $args parameter will be ignored.
|
||||||
* @param array $args {
|
* @param array $args {
|
||||||
* Optional. Array of block type arguments. Any arguments may be defined, however the
|
* Optional. Array of block type arguments. Accepts any public property of `WP_Block_Type`.
|
||||||
* ones described below are supported by default. Default empty array.
|
* 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 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
|
* @since 5.0.0
|
||||||
*
|
*
|
||||||
* @param string|WP_Block_Type $name Block type name including namespace, or alternatively a
|
* @param string|WP_Block_Type $name Block type name including namespace, or alternatively
|
||||||
* complete WP_Block_Type instance.
|
* a complete WP_Block_Type instance.
|
||||||
* @return WP_Block_Type|false The unregistered block type on success, or false on failure.
|
* @return WP_Block_Type|false The unregistered block type on success, or false on failure.
|
||||||
*/
|
*/
|
||||||
function unregister_block_type( $name ) {
|
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
|
* Finds a script handle for the selected block metadata field. It detects
|
||||||
* when a path to file was provided and finds a corresponding
|
* when a path to file was provided and finds a corresponding asset file
|
||||||
* asset file with details necessary to register the script under
|
* with details necessary to register the script under automatically
|
||||||
* automatically generated handle name. It returns unprocessed script handle
|
* generated handle name. It returns unprocessed script handle otherwise.
|
||||||
* otherwise.
|
|
||||||
*
|
*
|
||||||
* @since 5.5.0
|
* @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
|
* @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.
|
* the block or path to the folder where the `block.json` file is located.
|
||||||
* @param array $args {
|
* @param array $args {
|
||||||
* Optional. Array of block type arguments. Any arguments may be defined, however the
|
* Optional. Array of block type arguments. Accepts any public property of `WP_Block_Type`.
|
||||||
* ones described below are supported by default. Default empty array.
|
* 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 callable $render_callback Callback used to render blocks of this block type.
|
||||||
* }
|
* }
|
||||||
|
|
|
@ -34,16 +34,16 @@ final class WP_Block_Type_Registry {
|
||||||
*
|
*
|
||||||
* @since 5.0.0
|
* @since 5.0.0
|
||||||
*
|
*
|
||||||
* @param string|WP_Block_Type $name Block type name including namespace, or alternatively a
|
* @param string|WP_Block_Type $name Block type name including namespace, or alternatively
|
||||||
* complete WP_Block_Type instance. In case a WP_Block_Type
|
* a complete WP_Block_Type instance. In case a WP_Block_Type
|
||||||
* is provided, the $args parameter will be ignored.
|
* is provided, the $args parameter will be ignored.
|
||||||
* @param array $args {
|
* @param array $args {
|
||||||
* Optional. Array of block type arguments. Any arguments may be defined, however the
|
* Optional. Array of block type arguments. Accepts any public property of `WP_Block_Type`.
|
||||||
* ones described below are supported by default. Default empty array.
|
* 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 callable $render_callback Callback used to render blocks of this block type.
|
||||||
* @type array $attributes Block attributes mapping, property name to schema.
|
* @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.
|
* @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
|
* @since 5.0.0
|
||||||
*
|
*
|
||||||
* @param string|WP_Block_Type $name Block type name including namespace, or alternatively a
|
* @param string|WP_Block_Type $name Block type name including namespace, or alternatively
|
||||||
* complete WP_Block_Type instance.
|
* a complete WP_Block_Type instance.
|
||||||
* @return WP_Block_Type|false The unregistered block type on success, or false on failure.
|
* @return WP_Block_Type|false The unregistered block type on success, or false on failure.
|
||||||
*/
|
*/
|
||||||
public function unregister( $name ) {
|
public function unregister( $name ) {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue