Home › Forums › Calendar Products › Events Calendar PRO › disable Tag meta box on the backend
- This topic has 5 replies, 2 voices, and was last updated 5 years, 11 months ago by Boris.
-
AuthorPosts
-
May 8, 2018 at 9:32 am #1525341BorisParticipant
I’m trying to hide the Tag meta box from view for anyone making a new event from the admin panel.
To remove the metabox, I have the following code at the bottom of my functions.php file:
add_action( 'admin_menu', 'remove_backend_meta_box'); function remove_backend_meta_box() { remove_meta_box ( 'tagsdiv-post_tag', 'post', 'side'); }
sources I’ve looked at:
https://codex.wordpress.org/Function_Reference/remove_meta_box
https://stackoverflow.com/questions/35113196/remove-metabox-from-custom-post-editor
https://wordpress.stackexchange.com/questions/240836/hiding-a-themes-meta-box
https://tommcfarlin.com/remove-wordpress-meta-boxes/To remove the link in the admin panel to edit tags, I am using the following at the bottom of my functions.php file:
add_action('admin_menu', 'my_remove_sub_menus'); function my_remove_sub_menus() { remove_submenu_page('edit.php?post_type=tribe_events', 'edit-tags.php?taxonomy=post_tag&post_type=tribe_events'); }
Sources:
https://codex.wordpress.org/Function_Reference/remove_submenu_page
https://wordpress.stackexchange.com/questions/110782/remove-categories-tags-from-admin-menu/236211Neither one seems to be doing the trick.
May 9, 2018 at 7:46 am #1526159SkyKeymasterHi there!
Thanks for reaching out. I will try to help figure out how to do this.
It looks like you were close! Here is a snippet for removing the metabox:
add_action( 'admin_menu', 'tft_remove_taxonomy_metabox', 999);
function tft_remove_taxonomy_metabox() {
remove_meta_box('tagsdiv-post_tag', 'tribe_events', 'side');
}
and for removing the menu item:
add_action('admin_menu', 'my_remove_sub_menus', 999);
function my_remove_sub_menus() {
remove_submenu_page( 'edit.php?post_type=tribe_events', 'edit-tags.php?taxonomy=post_tag&post_type=tribe_events' );
}
Let me know if that works for you!
Thanks,
SkyMay 9, 2018 at 9:01 am #1526249BorisParticipantThanks! Removing the Tag metabox works. Putting in the appropriate execution time did the trick.
This solution was hinted at in the Notes section of https://codex.wordpress.org/Function_Reference/remove_meta_box but gave no obvious recommendation.
However, removing the Events/Tags submenu still doesn’t work.
I tested to see if I could remove other items. I was able to remove Events/Venues and the default Post/Tags submenu items in the code below:
add_action('admin_menu', 'my_remove_sub_menus', 999); function my_remove_sub_menus() { remove_submenu_page( 'edit.php?post_type=tribe_events', 'taxonomy=post_tag&post_type=tribe_events' ); //no luck remove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=post_tag' ); //works remove_submenu_page( 'edit.php?post_type=tribe_events', 'edit.php?post_type=tribe_venue'); //also works }
May 10, 2018 at 6:39 am #1527153SkyKeymasterMay 10, 2018 at 6:49 am #1527170BorisParticipantYep! That works. Many thanks.
May 10, 2018 at 6:52 am #1527174SkyKeymasterAwesome!
Glad it worked for you.
Let us know if you have any questions or issues in the future.
Thanks,
SkyJune 1, 2018 at 9:35 am #1543979Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘disable Tag meta box on the backend’ is closed to new replies.