Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've created a custom post type with my requirements. I used "WP Video Gen" as menu label. But I want red marked item to name as "Videos". Is it possible? Ref: http://ScrnSht.com/jcvlhy

Thanks in advanced.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

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
share|improve this answer
    
In other words, the accepted answer is clearly wrong. –  alisspers Sep 26 '12 at 12:58
    
'all_items' => 'Videos', worked like charm. Thank you for your answer. Yes, the previous answer was wrong, Anyway, thanks. –  Enthusiast Sep 26 '12 at 13:46
    
+1 for following up even though there was an accepted answer. –  Brian Fegter Sep 29 '12 at 4:58

enter image description here

Is it possible?

Sorry, but no, this is not possible, due to the internal logic that WordPress applies to rendering the menu. The first submenu item is always the same as the Top level menu item (until you don't apply a fix that avoids copying them at all - not recommended as it destroys the default behavior and messes with what the user expects and sees with the remaining menu items).

Details

You can read more about changing how menu items behave in my article here.

share|improve this answer
1  
Thanks for explanation. –  Enthusiast Sep 24 '12 at 13:53
    
Sorry but your answer was not correct, @alisspers just explained. Anyway, thanks for your time. –  Enthusiast Sep 26 '12 at 13:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.