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.

Long story short, I am creating an Administration UI for my Homepage Slider, therefore I am hooking to the admin_menu as explained in the wordpress codex.

Basically, structure wise, I have only to pages:

  1. A page with all the slides - 'View All Slides'
  2. A page to add a new slide - 'Add New Slide'

I want all of the above to go under 'Homepage Slider' category. To get a better idea think how 'Pages' is displayed in the Dashboard.

Nevertheless, here is my menu function:

add_action('admin_menu', 'bones_home_slider_menu');

function home_slider_menu() {
    add_menu_page('Homepage Slider View',
        'Homepage Slider',
        'manage_options',
        'home_slider_main',
        'home_slider_main'
    );

    add_submenu_page('home_slider_main',
        'Add New Slide',
        'Add New',
        'manage_options',
        'home_slider_add_new',
        'home_slider_add_new'
    );

}

The problem is that add_menu_page creates the main menu item and a submenu when used with 'add_submenu_page':

enter image description here

I've tried to create another submenu, however I don't know how to make 'Homepage Slider' disappear from the submenu.

share|improve this question
1  
look this answer. wordpress.stackexchange.com/questions/34363/… –  ahmetlutfu May 31 at 23:32
    
Thanks, that helped. –  Dragos Rizescu Jun 1 at 8:22

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.