Custom Post Type menu name

When you register your custom post type there’s an argument called ‘labels’ you can pass to register_post_type(). The argument is an associative array with named labels for the menu and screens of your post type. Specifically, the label you are looking for is called ‘all_items’.

I don’t know your code for registering the post type, but here’s a short example that does what you asked for:

function video_gen_init() {
    register_post_type( 'video_gen', array(
        'public' => true,
        'labels' => array(
            'name'      => 'WP Video Gen',
            'all_items' => 'Videos',
        ),
    ) );
}
add_action( 'init', 'video_gen_init' );

Other available labels are (according to the WordPress Codex by the time of writing):

  • ‘name’ – general name for the post type, usually plural. The same as, and overridden by $post_type_object->label
  • ‘singular_name’ – name for one object of this post type. Defaults to value of name
  • ‘add_new’ – the add new text. The default is Add New for both
    hierarchical and non-hierarchical types. When internationalizing this
    string, please use a gettext context matching your post type.
    Example: _x(‘Add New’, ‘product’);
  • ‘all_items’ – the all items text used in the menu. Default is the
    Name label
  • ‘add_new_item’ – the add new item text. Default is Add New Post/Add
    New Page
  • ‘edit_item’ – the edit item text. Default is Edit Post/Edit Page
  • ‘new_item’ – the new item text. Default is New Post/New Page
  • ‘view_item’ – the view item text. Default is View Post/View Page
  • ‘search_items’ – the search items text. Default is Search
    Posts/Search Pages
  • ‘not_found’ – the not found text. Default is No posts found/No pages
    found
  • ‘not_found_in_trash’ – the not found in trash text. Default is No
    posts found in Trash/No pages found in Trash
  • ‘parent_item_colon’ – the parent text. This string isn’t used on
    non-hierarchical types. In hierarchical ones the default is Parent
    Page
  • ‘menu_name’ – the menu name text. This string is the name to give
    menu items. Defaults to value of name

Leave a Comment