Make WordPress Core


Ignore:
Timestamp:
10/03/2024 10:44:30 PM (5 weeks ago)
Author:
joedolson
Message:

Administration: Switch core post type labels to add_new_item.

In [56515], the default value of Add New was changed to "Add New Post / Add New Page". This caused problems with post types where add_new was not declared.

Change core usage to reference the add_new_item value and revert the default value of add_new back to "Add New / Add New". This retains the accessibility advantages without creating counter intuitive usage of the add_new key.

With this change, post types registered with no add_new key will be unimpacted in core, and post types registered with no add_new_item key will use the default "Add New Post", which is not a change from the current state.

Props smerriman, afercia, rcreators, joedolson, eclev91, johnbillion.
Fixes #60045.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/menu.php

    r58278 r59161  
    170170    $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 );
    171171    $submenu[ $ptype_file ][5]    = array( $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, $ptype_file );
    172     $submenu[ $ptype_file ][10]   = array( $ptype_obj->labels->add_new, $ptype_obj->cap->create_posts, $post_new_file );
     172    $submenu[ $ptype_file ][10]   = array( $ptype_obj->labels->add_new_item, $ptype_obj->cap->create_posts, $post_new_file );
    173173
    174174    $i = 15;
Note: See TracChangeset for help on using the changeset viewer.