From 09f9cbc691624ea0986a31f45385d91e49ed94d9 Mon Sep 17 00:00:00 2001 From: Joe Dolson Date: Thu, 3 Oct 2024 17:13:54 -0500 Subject: [PATCH] Merge in 60045 --- src/wp-admin/edit-form-advanced.php | 2 +- src/wp-admin/edit.php | 2 +- src/wp-admin/menu.php | 2 +- src/wp-includes/class-wp-post-type.php | 2 +- src/wp-includes/post.php | 3 ++- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/wp-admin/edit-form-advanced.php b/src/wp-admin/edit-form-advanced.php index 91780372678d9..68218d4f2dd20 100644 --- a/src/wp-admin/edit-form-advanced.php +++ b/src/wp-admin/edit-form-advanced.php @@ -434,7 +434,7 @@ cap->create_posts ) ) { - echo ' ' . esc_html( $post_type_object->labels->add_new ) . ''; + echo ' ' . esc_html( $post_type_object->labels->add_new_item ) . ''; } ?> diff --git a/src/wp-admin/edit.php b/src/wp-admin/edit.php index 93bcef797f9ae..15cb17d303bd3 100644 --- a/src/wp-admin/edit.php +++ b/src/wp-admin/edit.php @@ -419,7 +419,7 @@ cap->create_posts ) ) { - echo ' ' . esc_html( $post_type_object->labels->add_new ) . ''; + echo ' ' . esc_html( $post_type_object->labels->add_new_item ) . ''; } if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { diff --git a/src/wp-admin/menu.php b/src/wp-admin/menu.php index 03a2ed871a0f0..3f0a773414a1a 100644 --- a/src/wp-admin/menu.php +++ b/src/wp-admin/menu.php @@ -169,7 +169,7 @@ $menu[ $ptype_menu_position ] = array( esc_attr( $ptype_obj->labels->menu_name ), $ptype_obj->cap->edit_posts, $ptype_file, '', $menu_class, $ptype_menu_id, $menu_icon ); $submenu[ $ptype_file ][5] = array( $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, $ptype_file ); - $submenu[ $ptype_file ][10] = array( $ptype_obj->labels->add_new, $ptype_obj->cap->create_posts, $post_new_file ); + $submenu[ $ptype_file ][10] = array( $ptype_obj->labels->add_new_item, $ptype_obj->cap->create_posts, $post_new_file ); $i = 15; foreach ( get_taxonomies( array(), 'objects' ) as $tax ) { diff --git a/src/wp-includes/class-wp-post-type.php b/src/wp-includes/class-wp-post-type.php index 69a6db36fd12f..5336d3e1cf8f3 100644 --- a/src/wp-includes/class-wp-post-type.php +++ b/src/wp-includes/class-wp-post-type.php @@ -973,7 +973,7 @@ public static function get_default_labels() { self::$default_labels = 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( __( 'Add New Post' ), __( 'Add New Page' ) ), + 'add_new' => array( __( 'Add New' ), __( 'Add New' ) ), 'add_new_item' => array( __( 'Add New Post' ), __( 'Add New Page' ) ), 'edit_item' => array( __( 'Edit Post' ), __( 'Edit Page' ) ), 'new_item' => array( __( 'New Post' ), __( 'New Page' ) ), diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 9896139937100..e203685010741 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -2022,7 +2022,7 @@ function _post_type_meta_capabilities( $capabilities = null ) { * - `name` - General name for the post type, usually plural. The same and overridden * by `$post_type_object->label`. Default is 'Posts' / 'Pages'. * - `singular_name` - Name for one object of this post type. Default is 'Post' / 'Page'. - * - `add_new` - Label for adding a new item. Default is 'Add New Post' / 'Add New Page'. + * - `add_new` - Label for adding a new item. Default is 'Add New' / 'Add New'. * - `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'. * - `new_item` - Label for the new item page title. Default is 'New Post' / 'New Page'. @@ -2084,6 +2084,7 @@ function _post_type_meta_capabilities( $capabilities = null ) { * @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. * @since 6.6.0 Added the `template_name` label. + * @since 6.7.0 Restored default values for the `add_new` label and updated documentation. * * @access private *