I’ve managed to solve this using Javascript to ‘open’ the menu item when on the edit tags page in the plugin.
Relevant plugin PHP file
$screen = get_current_screen();
// Check we're only on the edit-tags page in the plugin
if ('edit-tags' === $screen->base && 'subscriber' === $screen->post_type) {
wp_enqueue_script( $this->plugin_slug . '-subscriber-edit-tags-script', plugins_url('assets/js/subscriber-edit-tags.js', __FILE__ ), array('jquery') );
}
subscriber-edit-tags.js (using jQuery)
(function ( $ ) {
/**
* File is called only when on edit tags under subscriber post type
*/
$('.toplevel_page_my_plugin')
.removeClass('wp-not-current-submenu')
.addClass('wp-has-current-submenu wp-menu-open')
.find('li').has('a[href*="edit-tags.php"]')
.addClass('current');
}(jQuery));
Related Posts:
- Add location tag to wordpress posts
- add_menu_page() with different name for first submenu item
- What’s the difference between term_id and term_taxonomy_id
- How to add sub-menu to a menu generated by wp_nav_menu by using plugin
- On the WordPress Admin section how do I link to submenu pages created for a plugin?
- Plugin – create a page without it appearing in the side menu
- Inserting Taxonomy Terms During a Plugin Activation?
- Copy Tags from one post type to another post type
- How to add more than 1 user role to sub-menu pages
- Odd behaviour with submenu link creation
- Rewrite Point Doesn’t Work on Custom Taxonomy
- can I prevent WP users (even admin) from deleting custom categories?
- Is there a way to list tags order by post_meta field
- How to restrict plugin’s sub-menu pages to admin/subscribers?
- How to avoid creating first submenu page that is same as menu page?
- If a function requires add_action(‘init’) how can I run it only once on plugin activation?
- Is there a Filter that I can use to filter the tags before they are inserted in to the database?
- Custom plugin: Loop through taxonomy types and update columns for all types?
- Insert terms for custom taxonomy on plugin activation, or each page load (init hook)
- Custom Taxonomy to dropdown box on adminside wordpress
- How to add a custom taxonomy to show up in a custom post type menu?
- Sub Menu content is being duplicated
- Is there a plugin that will allow a tag cloud to be created from any mysql field?
- $_FILES empty on created_{taxonomy} and create_{taxonomy} yet is is not on edit_{taxonomy}
- Search the product by tag or category not working
- Why is the WordPress taxonomy not registering?
- Is there documentation reference for forms in menu and setting pages?
- Translate slug in WPMU with PO files
- How to Get Current Custom Post Type Associated Taxonomy Term
- How to remove plugin-specific custom taxonomy terms when plugin is uninstalled?
- get_the_tags with separator control?
- Add child pages to submenu automatically
- Print Dashboard submenu name and filename
- term_exists() returning NULL on term that exists
- Taxonomies within plugin invalid
- Let plugin check if taxonomy is already registered by another plugin
- add_action pre_term_description vs. pre_category_description
- Non editable custom taxonomy
- modify show UI of a registered taxonomy
- How to create taxonomy without using register_taxonomy () function
- Using init hook for register_taxonomy is causing invalid_taxonomy in wp_insert_term()
- Why won’t this submenu page show? – My First WordPress Plugin
- How to create a custom post-new.php page for plugin , no wp menu
- Add default custom taxonomy to plugin activation
- Determine if term is Category or Tag
- Add a custom submenu under submenu in a Custom WordPress Plugin
- Remove tag from all posts when publishing new post
- Javascript not being loaded only in custom taxonomy template
- set a custom post type to a taxonomy term programmatically in metabox
- Dynamically getting tags in post edit screen
- Making Woocommerce optimized for more than 500k products
- Add a new tag based on the category name in the publish event
- How put the correct URL to sub-menu plugin?
- Add Admin menus or submenus depending on conditions
- add_action priority and taxonomy used in plugin
- Organizing The Custom Post Type with Taxonomies / Parent Posts
- Access WordPress Tag Function From Modal
- How to display custom taxonomy and terms using/creating plugin template
- How to show custom taxonomy child posts through shortcode in WordPress
- Adding querystring variable breaks admin URLs
- If I want to create new taxonomies (e.g. Project / Documents / Etc…) is it better to create them in the theme’s functions.php or within a plugin? [duplicate]
- Is the only way to add taxonomy terms via an admin panel?
- WordPress Breadcrumb Taxonomy Display
- get_the_tags($ID) is empty during publish_post callback
- How to boost WP custom post REST API GET queries by custom taxonomies
- Custom database table entry edit page
- How to run this plugin every time a post is saved?
- Create child of child custom page in wp-admin
- Render custom taxonomy query as single template
- Plugin settings not saving and 404 is generated on submit
- Do a summary based on sections in a post
- Plugin as custom page
- Refresh or redirect page after activate my plugin
- Why is ‘register_activation_hook’ undefined?
- variable created in page.php is null inside of header.php
- Issue on Getting WP Gallery Items In cpt-single.php As Attachments
- Plugin translation not being displayed
- How to create an embedded code for wordpress shortcode?
- Can’t switch theme after activation
- Error when trying to save custom post type settings (ERROR: options page not found)
- Loop multiple taxonomy in custom post
- Can a standalone app be made to work as a WordPress plugin?
- What happens when you create/edit a menu
- Forcing ALL plugin Admin menus into a separate menu
- Script work on non logged in user but not work for logged in user?
- Best place to keep files that are called by cron jobs?
- I can install my plugin in localhost but not in my server
- Generating List of Tags from Custom Post Type
- How to make auto installer Plugin?
- Sessions in plugin development?
- ouput buffering confusing me!
- Plugin error on activation – breaks page encoding and prints the code of plugin php files
- Children Shortcodes?
- Get Posts by tag from a custom taxonomy
- Archive.php is not displaying tags
- How to load another page file of my custom plugin file
- Add a Submenu from Another Submenu in a Custom Theme
- Include add_post_meta in a plugin
- Generate activation url
- save_post not called in plugin / custom field still saving overwriting metaboxes