From 1446948f95fcb4c8fa05cb3c7ac6c22ba5f6fb52 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 13 Mar 2021 10:23:56 +0000 Subject: [PATCH] Docs: Add missing `@since` tags for `item_link` and `item_link_description` post type and taxonomy labels. Follow-up to [50527]. See #52688. git-svn-id: https://develop.svn.wordpress.org/trunk@50529 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-block-type.php | 1 + src/wp-includes/post.php | 4 +++- .../endpoints/class-wp-rest-block-types-controller.php | 2 +- src/wp-includes/taxonomy.php | 4 +++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/class-wp-block-type.php b/src/wp-includes/class-wp-block-type.php index 30ba9ff407..6a028b304c 100644 --- a/src/wp-includes/class-wp-block-type.php +++ b/src/wp-includes/class-wp-block-type.php @@ -101,6 +101,7 @@ class WP_Block_Type { /** * Block variations. + * * @since 5.8.0 * @var array */ diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 88ee84d584..ced0275db4 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -1722,6 +1722,7 @@ function _post_type_meta_capabilities( $capabilities = null ) { * @since 5.0.0 Added the `item_published`, `item_published_privately`, `item_reverted_to_draft`, * `item_scheduled`, and `item_updated` labels. * @since 5.7.0 Added the `filter_by_date` label. + * @since 5.8.0 Added the `item_link` and `item_link_description` labels. * * @access private * @@ -1729,7 +1730,7 @@ function _post_type_meta_capabilities( $capabilities = null ) { * @return object Object with all the labels as member variables. */ function get_post_type_labels( $post_type_object ) { - $nohier_vs_hier_defaults = array( + $nohier_vs_hier_defaults = array( 'name' => array( _x( 'Posts', 'post type general name' ), _x( 'Pages', 'post type general name' ) ), 'singular_name' => array( _x( 'Post', 'post type singular name' ), _x( 'Page', 'post type singular name' ) ), 'add_new' => array( _x( 'Add New', 'post' ), _x( 'Add New', 'page' ) ), @@ -1769,6 +1770,7 @@ function get_post_type_labels( $post_type_object ) { _x( 'A link to a page.', 'navigation link block description' ), ), ); + $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; $labels = _get_custom_object_labels( $post_type_object, $nohier_vs_hier_defaults ); diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php index f2f277e5eb..7dc49bc4d5 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php @@ -362,7 +362,7 @@ class WP_REST_Block_Types_Controller extends WP_REST_Controller { return $this->add_additional_fields_schema( $this->schema ); } - //rest_validate_value_from_schema doesn't understand $refs, pull out reused definitions for readability. + // rest_validate_value_from_schema doesn't understand $refs, pull out reused definitions for readability. $inner_blocks_definition = array( 'description' => __( 'The list of inner blocks used in the example.' ), 'type' => 'array', diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index 13298022c1..07d1e44c44 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -538,6 +538,7 @@ function unregister_taxonomy( $taxonomy ) { * @since 4.4.0 Added the `items_list_navigation` and `items_list` labels. * @since 4.9.0 Added the `most_used` and `back_to_items` labels. * @since 5.7.0 Added the `filter_by_item` label. + * @since 5.8.0 Added the `item_link` and `item_link_description` labels. * * @param WP_Taxonomy $tax Taxonomy object. * @return object { @@ -579,7 +580,7 @@ function unregister_taxonomy( $taxonomy ) { * @type string $item_link Used in the block editor. Title for a navigation link block variation. * Default 'Tag Link'/'Category Link'. * @type string $item_link_description Used in the block editor. Description for a navigation link block - * variation. Default 'A link to a tag.'/'A link to a category'. + * variation. Default 'A link to a tag'/'A link to a category'. * } */ function get_taxonomy_labels( $tax ) { @@ -626,6 +627,7 @@ function get_taxonomy_labels( $tax ) { _x( 'A link to a category.', 'navigation link block description' ), ), ); + $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; $labels = _get_custom_object_labels( $tax, $nohier_vs_hier_defaults );