WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Adding a Sub Menu Tab in Admin page (8 posts)

  1. smarru
    Member
    Posted 2 years ago #

    Can anyone please help me add a new submenu tab called "Location Category" under the Events box on the admin page?

    I tried to use the below code on the functions.php file but it doesn't work.

    add_action('admin_menu', 'register_my_custom_submenu_page');

    function register_my_custom_submenu_page() {
    add_submenu_page( 'events-manager-options', 'Location Category', 'Location Category', 'install_plugins', 'events-manager-options', 'edit-tags.php?taxonomy=location-category' );
    }

    Thank you for any help!
    Srilatha

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 2 years ago #

  3. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    check admin/em-admin.php, second function, we add submenu pages there

  4. smarru
    Member
    Posted 2 years ago #

    Thank you for helping me.

    @agelonwl,
    I tried to look at this page http://wp-events-plugin.com/tutorials/create-a-custom-events-admin-page/ and I am able to add "Styles" page but not "Location Category" page. The difference between those two pages is - Styles page is added with filename 'edit.php' and for Location Category is a taxonomy page and it is added with 'edit-tags.php'.

    Marcus, I looked at the admin/em-admin.php and it is not specific to a page. I want to add a page tab similar to "Event Categories". Is it possible? Here is the statement in admin/em-admin.php-
    add_submenu_page('events-manager-options', __('Update Blogs','dbem'),__('Update Blogs','dbem'), 'activate_plugins', "events-manager-update", 'em_ms_upgrade');

    The page I want to add is edit-tags.php?taxonomy=location-category and my function is
    add_submenu_page( 'events-manager-options', 'Location Category', 'Location Category', 'install_plugins', 'events-manager-options', 'edit-tags.php?taxonomy=location-category' );

    Thank you,
    Srilatha

  5. smarru
    Member
    Posted 2 years ago #

    Sorry, I tried to understand little more about add_submenu_page and used the following code which worked. Also I separated out the locations into a new menu tab.

    I missed the point of parent slug before. Now I replaced the parent slug 'event-manager-options' with 'edit.php?post_type=location' which is working.

    add_menu_page( 'Location Options', 'Locations', 'edit_others_posts', 'edit.php?post_type=location', '', '/wp-content/themes/twentyeleven/images/MapMarker_Bubble_Azure.png', 25);
    
    	add_submenu_page( 'edit.php?post_type=location', 'Location Categories', 'Location Categories', 'manage_options', 'edit-tags.php?taxonomy=location-category&post_type=location' );

    Thank you,
    Srilatha

  6. agelonwl
    Member
    Posted 2 years ago #

    thanks for updating.

  7. ciccimanolesta
    Member
    Posted 2 years ago #

    I'm trying to add you code smarru but in wp-events v. 5.1.3 submenu link generate an error:

    "Invalid taxonomy"

    the link is: /wp-admin/edit-tags.php?taxonomy=location-category&post_type=location

    Is there some other hacking code to do?

    Thanxs

  8. ciccimanolesta
    Member
    Posted 2 years ago #

    Done. Taxonomy is "loccategories".

    Thanx to all!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic