Docs: Various docblock corrections for code added in 5.8.

Props johnbillion.
See #53461.
Built from https://develop.svn.wordpress.org/trunk@51221


git-svn-id: http://core.svn.wordpress.org/trunk@50830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2021-06-23 19:05:57 +00:00
parent a048ac3ccd
commit fccc020d29
14 changed files with 99 additions and 114 deletions

View File

@ -10,7 +10,7 @@
/** /**
* Returns the list of default categories for block types. * Returns the list of default categories for block types.
* *
* @since 5.8.0. * @since 5.8.0
* *
* @return array[] Array of categories for block types. * @return array[] Array of categories for block types.
*/ */

View File

@ -45,7 +45,7 @@ function wp_register_border_support( $block_type ) {
* @since 5.8.0 * @since 5.8.0
* @access private * @access private
* *
* @param WP_Block_type $block_type Block type. * @param WP_Block_Type $block_type Block type.
* @param array $block_attributes Block attributes. * @param array $block_attributes Block attributes.
* *
* @return array Border CSS classes and inline styles. * @return array Border CSS classes and inline styles.
@ -123,7 +123,7 @@ function wp_apply_border_support( $block_type, $block_attributes ) {
* @since 5.8.0 * @since 5.8.0
* @access private * @access private
* *
* @param WP_Block_type $block_type Block type. * @param WP_Block_Type $block_type Block type.
* *
* @return boolean * @return boolean
*/ */

View File

@ -56,9 +56,8 @@ function _build_template_result_from_post( $post ) {
* @type array $slug__in List of slugs to include. * @type array $slug__in List of slugs to include.
* @type int $wp_id Post ID of customized template. * @type int $wp_id Post ID of customized template.
* } * }
* @param string $template_type wp_template. * @param string $template_type Optional. The template type (post type). Default 'wp_template'.
* * @return WP_Block_Template[] Block template objects.
* @return array Templates.
*/ */
function get_block_templates( $query = array(), $template_type = 'wp_template' ) { function get_block_templates( $query = array(), $template_type = 'wp_template' ) {
$wp_query_args = array( $wp_query_args = array(

View File

@ -93,10 +93,8 @@ function locate_block_template( $template, $type, array $templates ) {
* @access private * @access private
* @since 5.8.0 * @since 5.8.0
* *
* Accepts an optional $template_hierarchy argument as a hint.
*
* @param string $template_type The current template type. * @param string $template_type The current template type.
* @param string[] $template_hierarchy (optional) The current template hierarchy, ordered by priority. * @param string[] $template_hierarchy The current template hierarchy, ordered by priority.
* @return WP_Block_Template|null template A template object, or null if none could be found. * @return WP_Block_Template|null template A template object, or null if none could be found.
*/ */
function resolve_block_template( $template_type, $template_hierarchy ) { function resolve_block_template( $template_type, $template_hierarchy ) {
@ -187,10 +185,10 @@ function get_the_block_template_html() {
/** /**
* Renders a 'viewport' meta tag. * Renders a 'viewport' meta tag.
* *
* This is hooked into {@see 'wp_head'} to decouple its output from the default template canvas.
*
* @access private * @access private
* @since 5.8.0 * @since 5.8.0
*
* This is hooked into {@see 'wp_head'} to decouple its output from the default template canvas.
*/ */
function _block_template_viewport_meta_tag() { function _block_template_viewport_meta_tag() {
echo '<meta name="viewport" content="width=device-width, initial-scale=1" />' . "\n"; echo '<meta name="viewport" content="width=device-width, initial-scale=1" />' . "\n";

View File

@ -214,8 +214,6 @@ function register_block_type_from_metadata( $file_or_folder, $args = array() ) {
/** /**
* Add `style` and `editor_style` for core blocks if missing. * Add `style` and `editor_style` for core blocks if missing.
*
* @since 5.8.0
*/ */
if ( ! empty( $metadata['name'] ) && 0 === strpos( $metadata['name'], 'core/' ) ) { if ( ! empty( $metadata['name'] ) && 0 === strpos( $metadata['name'], 'core/' ) ) {
$block_name = str_replace( 'core/', '', $metadata['name'] ); $block_name = str_replace( 'core/', '', $metadata['name'] );

View File

@ -326,13 +326,12 @@ abstract class WP_Image_Editor {
* *
* @since 5.8.0 * @since 5.8.0
* *
* @param array $output_format { * @param string[] $output_format {
* An array of mime type mappings. Maps a source mime type to a new * An array of mime type mappings. Maps a source mime type to a new
* destination mime type. Default empty array. * destination mime type. Default empty array.
* *
* @type array $mime_type The source mime type { * @type string ...$0 The new mime type.
* @type string $mime_type The new mime type. * }
* }
* @param string $filename Path to the image. * @param string $filename Path to the image.
* @param string $mime_type The source image mime type. * @param string $mime_type The source image mime type.
* } * }

View File

@ -265,7 +265,7 @@ class WP_Theme_JSON_Resolver {
* *
* @since 5.8.0 * @since 5.8.0
* *
* @param array $theme_support_data Theme support data in theme.json format. * @param array $theme_support_data Theme support data in theme.json format. Default empty array.
* @return WP_Theme_JSON Entity that holds theme data. * @return WP_Theme_JSON Entity that holds theme data.
*/ */
public static function get_theme_data( $theme_support_data = array() ) { public static function get_theme_data( $theme_support_data = array() ) {
@ -318,7 +318,9 @@ class WP_Theme_JSON_Resolver {
/** /**
* Whether the current theme has a theme.json file. * Whether the current theme has a theme.json file.
* *
* @return boolean * @since 5.8.0
*
* @return bool
*/ */
public static function theme_has_support() { public static function theme_has_support() {
if ( ! isset( self::$theme_has_support ) ) { if ( ! isset( self::$theme_has_support ) ) {

View File

@ -355,23 +355,23 @@ class WP_Theme_JSON {
* *
* Example: * Example:
* *
* { * {
* 'core/paragraph': { * 'core/paragraph': {
* 'selector': 'p', * 'selector': 'p',
* 'elements': { * 'elements': {
* 'link' => 'link selector', * 'link' => 'link selector',
* 'etc' => 'element selector' * 'etc' => 'element selector'
* }
* },
* 'core/heading': {
* 'selector': 'h1',
* 'elements': {}
* }
* 'core/group': {
* 'selector': '.wp-block-group',
* 'elements': {}
* }
* } * }
* },
* 'core/heading': {
* 'selector': 'h1',
* 'elements': {}
* }
* 'core/group': {
* 'selector': '.wp-block-group',
* 'elements': {}
* }
* }
* *
* @since 5.8.0 * @since 5.8.0
* *
@ -517,25 +517,25 @@ class WP_Theme_JSON {
* Additionally, it'll also create new rulesets * Additionally, it'll also create new rulesets
* as classes for each preset value such as: * as classes for each preset value such as:
* *
* .has-value-color { * .has-value-color {
* color: value; * color: value;
* } * }
* *
* .has-value-background-color { * .has-value-background-color {
* background-color: value; * background-color: value;
* } * }
* *
* .has-value-font-size { * .has-value-font-size {
* font-size: value; * font-size: value;
* } * }
* *
* .has-value-gradient-background { * .has-value-gradient-background {
* background: value; * background: value;
* } * }
* *
* p.has-value-gradient-background { * p.has-value-gradient-background {
* background: value; * background: value;
* } * }
* *
* @since 5.8.0 * @since 5.8.0
* *
@ -580,10 +580,10 @@ class WP_Theme_JSON {
* *
* For each section this creates a new ruleset such as: * For each section this creates a new ruleset such as:
* *
* block-selector { * block-selector {
* --wp--preset--category--slug: value; * --wp--preset--category--slug: value;
* --wp--custom--variable: value; * --wp--custom--variable: value;
* } * }
* *
* @since 5.8.0 * @since 5.8.0
* *
@ -613,9 +613,6 @@ class WP_Theme_JSON {
* Given a selector and a declaration list, * Given a selector and a declaration list,
* creates the corresponding ruleset. * creates the corresponding ruleset.
* *
* To help debugging, will add some space
* if SCRIPT_DEBUG is defined and true.
*
* @since 5.8.0 * @since 5.8.0
* *
* @param string $selector CSS selector. * @param string $selector CSS selector.
@ -731,12 +728,10 @@ class WP_Theme_JSON {
* for the presets and adds them to the $declarations array * for the presets and adds them to the $declarations array
* following the format: * following the format:
* *
* ```php * array(
* array( * 'name' => 'property_name',
* 'name' => 'property_name', * 'value' => 'property_value,
* 'value' => 'property_value, * )
* )
* ```
* *
* @since 5.8.0 * @since 5.8.0
* *
@ -765,12 +760,10 @@ class WP_Theme_JSON {
* for the custom values and adds them to the $declarations * for the custom values and adds them to the $declarations
* array following the format: * array following the format:
* *
* ```php * array(
* array( * 'name' => 'property_name',
* 'name' => 'property_name', * 'value' => 'property_value,
* 'value' => 'property_value, * )
* )
* ```
* *
* @since 5.8.0 * @since 5.8.0
* *
@ -808,19 +801,19 @@ class WP_Theme_JSON {
* For example, assuming the given prefix is '--wp' * For example, assuming the given prefix is '--wp'
* and the token is '--', for this input tree: * and the token is '--', for this input tree:
* *
* { * {
* 'some/property': 'value', * 'some/property': 'value',
* 'nestedProperty': { * 'nestedProperty': {
* 'sub-property': 'value' * 'sub-property': 'value'
* } * }
* } * }
* *
* it'll return this output: * it'll return this output:
* *
* { * {
* '--wp--some-property': 'value', * '--wp--some-property': 'value',
* '--wp--nested-property--sub-property': 'value' * '--wp--nested-property--sub-property': 'value'
* } * }
* *
* @since 5.8.0 * @since 5.8.0
* *
@ -856,12 +849,10 @@ class WP_Theme_JSON {
* Given a styles array, it extracts the style properties * Given a styles array, it extracts the style properties
* and adds them to the $declarations array following the format: * and adds them to the $declarations array following the format:
* *
* ```php * array(
* array( * 'name' => 'property_name',
* 'name' => 'property_name', * 'value' => 'property_value,
* 'value' => 'property_value, * )
* )
* ```
* *
* @since 5.8.0 * @since 5.8.0
* *
@ -967,16 +958,16 @@ class WP_Theme_JSON {
/** /**
* Builds metadata for the setting nodes, which returns in the form of: * Builds metadata for the setting nodes, which returns in the form of:
* *
* [ * [
* [ * [
* 'path' => ['path', 'to', 'some', 'node' ], * 'path' => ['path', 'to', 'some', 'node' ],
* 'selector' => 'CSS selector for some node' * 'selector' => 'CSS selector for some node'
* ], * ],
* [ * [
* 'path' => [ 'path', 'to', 'other', 'node' ], * 'path' => [ 'path', 'to', 'other', 'node' ],
* 'selector' => 'CSS selector for other node' * 'selector' => 'CSS selector for other node'
* ], * ],
* ] * ]
* *
* @since 5.8.0 * @since 5.8.0
* *
@ -1021,16 +1012,16 @@ class WP_Theme_JSON {
/** /**
* Builds metadata for the style nodes, which returns in the form of: * Builds metadata for the style nodes, which returns in the form of:
* *
* [ * [
* [ * [
* 'path' => [ 'path', 'to', 'some', 'node' ], * 'path' => [ 'path', 'to', 'some', 'node' ],
* 'selector' => 'CSS selector for some node' * 'selector' => 'CSS selector for some node'
* ], * ],
* [ * [
* 'path' => ['path', 'to', 'other', 'node' ], * 'path' => ['path', 'to', 'other', 'node' ],
* 'selector' => 'CSS selector for other node' * 'selector' => 'CSS selector for other node'
* ], * ],
* ] * ]
* *
* @since 5.8.0 * @since 5.8.0
* *

View File

@ -667,7 +667,7 @@ function wp_start_object_cache() {
// Only perform the following checks once. // Only perform the following checks once.
/** /**
* Filters whether to enable loading of the objectcache.php drop-in. * Filters whether to enable loading of the object-cache.php drop-in.
* *
* This filter runs before it can be used by plugins. It is designed for non-web * This filter runs before it can be used by plugins. It is designed for non-web
* run-times. If false is returned, object-cache.php will never be loaded. * run-times. If false is returned, object-cache.php will never be loaded.

View File

@ -4356,7 +4356,7 @@ function wp_enqueue_media( $args = array() ) {
* *
* @since 5.8.0 * @since 5.8.0
* *
* @param bool $value The filtered value, defaults to `false`. * @param bool $infinite Whether the Media Library grid has infinite scrolling.
*/ */
$infinite_scrolling = apply_filters( 'media_library_infinite_scrolling', false ); $infinite_scrolling = apply_filters( 'media_library_infinite_scrolling', false );

View File

@ -42,8 +42,6 @@ class WP_REST_Templates_Controller extends WP_REST_Controller {
* Registers the controllers routes. * Registers the controllers routes.
* *
* @since 5.8.0 * @since 5.8.0
*
* @return void
*/ */
public function register_routes() { public function register_routes() {
// Lists all templates. // Lists all templates.

View File

@ -2603,7 +2603,7 @@ function wp_maybe_inline_styles() {
* *
* @since 5.8.0 * @since 5.8.0
* *
* @param int $total_inline_limit The file-size threshold, in bytes. Defaults to 20000. * @param int $total_inline_limit The file-size threshold, in bytes. Default 20000.
*/ */
$total_inline_limit = apply_filters( 'styles_inline_size_limit', $total_inline_limit ); $total_inline_limit = apply_filters( 'styles_inline_size_limit', $total_inline_limit );

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.8-beta3-51220'; $wp_version = '5.8-beta3-51221';
/** /**
* 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.

View File

@ -98,7 +98,7 @@ class WP_Widget_Block extends WP_Widget {
* *
* @since 5.8.0 * @since 5.8.0
* *
* @param array $content The HTML content of the current block widget. * @param string $content The HTML content of the current block widget.
* *
* @return string The classname to use in the block widget's container HTML. * @return string The classname to use in the block widget's container HTML.
*/ */
@ -191,9 +191,9 @@ class WP_Widget_Block extends WP_Widget {
* *
* @since 5.8.0 * @since 5.8.0
* *
* @param array $instance Current instance.
*
* @see WP_Widget_Custom_HTML::render_control_template_scripts() * @see WP_Widget_Custom_HTML::render_control_template_scripts()
*
* @param array $instance Current instance.
*/ */
public function form( $instance ) { public function form( $instance ) {
$instance = wp_parse_args( (array) $instance, $this->default_instance ); $instance = wp_parse_args( (array) $instance, $this->default_instance );