mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-08 14:44:37 +00:00
Docs: Improve documentation for WP_Block_Type properties.
Add a reference to `WP_Block_Type::__construct()` for information on accepted arguments in `register_block_type()`. Synchronize the documentation between several places, use `WP_Block_Type::__construct()` as the canonical source. Props ediamin, audrasjb, peterwilsoncc. Fixes #48640. git-svn-id: https://develop.svn.wordpress.org/trunk@50419 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -15,13 +15,9 @@
|
||||
* @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. 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.
|
||||
* }
|
||||
* @param array $args Optional. Array of block type arguments. Accepts any public property
|
||||
* of `WP_Block_Type`. See WP_Block_Type::__construct() for information
|
||||
* on accepted arguments. Default empty array.
|
||||
* @return WP_Block_Type|false The registered block type on success, or false on failure.
|
||||
*/
|
||||
function register_block_type( $name, $args = array() ) {
|
||||
@@ -190,13 +186,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. 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.
|
||||
* }
|
||||
* @param array $args Optional. Array of block type arguments. Accepts any public property
|
||||
* of `WP_Block_Type`. See WP_Block_Type::__construct() for information
|
||||
* on accepted arguments. Default empty array.
|
||||
* @return WP_Block_Type|false The registered block type on success, or false on failure.
|
||||
*/
|
||||
function register_block_type_from_metadata( $file_or_folder, $args = array() ) {
|
||||
|
||||
Reference in New Issue
Block a user