check admin/em-admin.php, second function, we add submenu pages there
Thread Starter
smarru
(@smarru)
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
Thread Starter
smarru
(@smarru)
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
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
Done. Taxonomy is “loccategories”.
Thanx to all!