Support » Plugin: Events Manager » [Plugin: Events Manager] Adding a Sub Menu Tab in Admin page

  • Resolved smarru


    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!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Marcus


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

    Thank you for helping me.

    I tried to look at this 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,

    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,

    thanks for updating.

    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?


    Done. Taxonomy is “loccategories”.

    Thanx to all!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Events Manager] Adding a Sub Menu Tab in Admin page’ is closed to new replies.