0

So I am new to WordPress plugin development, but I try to learn as fast as possible. Basically, I try to create a tabbed navigation for my custom plugin. What I've done so far, you ask?

  • one function for displaying menu in left navbar
    
    function mb_menu_page()
    {
    add_menu_page('Big Name', 'Big Name', 'edit_posts', 'bigname', 'mb_big_name', false, 1);
    add_submenu_page('bigname', 'Link1', 'Link1', 'edit_posts', 'bigname',  'mb_big_name');
    add_submenu_page('bigname', 'Link2', 'Link2', 'edit_posts', 'bigname2', 'mb_big_name2');
    }
    
  • add action
    add_action( 'admin_menu', 'mb_menu_page');
  • Two new functions(page content)
    mb_big_name() && mb_big_name2()

Now, how can I get all links for this menu in order to parse them and create my tabbed navigation?

Thank you!

0

You should be able to use the admin_url() function; it returns the admin URL with the first parameter appended, optionally:

admin_url( 'admin.php?page=bigname' );
4
  • I can't see how this can help me with my problem. Anyway, I created a global array to use for admin menu and tabbed navigation.Thank you. Jul 23 '14 at 7:26
  • You asked how to get the links of the menu items you created and that's what I provided. Jul 23 '14 at 10:21
  • I need an array with all links(link1, link2) in order to parse it and create the HTML for tabs. Jul 23 '14 at 10:55
  • I trust you know how to create an array. Good luck with your project. Jul 23 '14 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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