Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use "add_new_item" label for post types in admin menus and revert add…
…ing " Post" to the "add_new" default.
  • Loading branch information
ethanclevenger91 committed Sep 17, 2024
commit bb66b988c58787ac4b3aed20e3a08e7c4473e0e1
2 changes: 1 addition & 1 deletion src/wp-admin/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-post-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 Page' ) ),
'add_new_item' => array( __( 'Add New Post' ), __( 'Add New Page' ) ),
'edit_item' => array( __( 'Edit Post' ), __( 'Edit Page' ) ),
'new_item' => array( __( 'New Post' ), __( 'New Page' ) ),
Expand Down