Docs: Add a @since note for add_new labels change in get_post_type_labels().

Includes removing an obsolete recommendation to use a gettext context matching the post type for disambiguation, which would be redundant with the new labels, as they already include the type of content.

Follow-up [14571], [56515].

See #47125.
Built from https://develop.svn.wordpress.org/trunk@56519


git-svn-id: http://core.svn.wordpress.org/trunk@56031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-09-06 00:46:24 +00:00
parent 1141b9fee2
commit f69316e8a5
2 changed files with 4 additions and 4 deletions

View File

@ -1931,9 +1931,7 @@ function _post_type_meta_capabilities( $capabilities = null ) {
* - `name` - General name for the post type, usually plural. The same and overridden * - `name` - General name for the post type, usually plural. The same and overridden
* by `$post_type_object->label`. Default is 'Posts' / 'Pages'. * by `$post_type_object->label`. Default is 'Posts' / 'Pages'.
* - `singular_name` - Name for one object of this post type. Default is 'Post' / 'Page'. * - `singular_name` - Name for one object of this post type. Default is 'Post' / 'Page'.
* - `add_new` - Default is 'Add New Type' for both hierarchical and non-hierarchical types. * - `add_new` - Label for adding a new item. Default is 'Add New Post' / 'Add New Page'.
* When internationalizing this string, please use a {@link https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/#disambiguation-by-context gettext context}
* matching your post type. Example: `__( 'Add New Product', 'textdomain' );`.
* - `add_new_item` - Label for adding a new singular item. Default is 'Add New Post' / 'Add New Page'. * - `add_new_item` - Label for adding a new singular item. Default is 'Add New Post' / 'Add New Page'.
* - `edit_item` - Label for editing a singular item. Default is 'Edit Post' / 'Edit Page'. * - `edit_item` - Label for editing a singular item. Default is 'Edit Post' / 'Edit Page'.
* - `new_item` - Label for the new item page title. Default is 'New Post' / 'New Page'. * - `new_item` - Label for the new item page title. Default is 'New Post' / 'New Page'.
@ -1992,6 +1990,8 @@ function _post_type_meta_capabilities( $capabilities = null ) {
* @since 5.7.0 Added the `filter_by_date` label. * @since 5.7.0 Added the `filter_by_date` label.
* @since 5.8.0 Added the `item_link` and `item_link_description` labels. * @since 5.8.0 Added the `item_link` and `item_link_description` labels.
* @since 6.3.0 Added the `item_trashed` label. * @since 6.3.0 Added the `item_trashed` label.
* @since 6.4.0 Changed default values for the `add_new` label to include the type of content.
* This matches `add_new_item` and provides more context for better accessibility.
* *
* @access private * @access private
* *

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.4-alpha-56518'; $wp_version = '6.4-alpha-56519';
/** /**
* 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.