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?
- Admin adding submenu that has the same destination as the parent menu
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- How can I add an image upload field directly to a custom write panel?
- How to return only certain fields using get_posts()
- Where is it better to start learning how to develop for WordPress?
- Is there any way to test if a function running only on plugin update is successfully running?
- Using wp_cron with custom time interval and the register activation hook
- Throw 403 in a plugin [duplicate]
- How can I view all WP generated thumbnails in Media Manager?
- Only allow plugin to be activated on root site of multisite
- Load page template with custom content using a plugin
- How to put placeholder text in the main post input area?
- how to redirect to another post without getting headers already sent error?
- Redirect user to a particular link in 10 seconds after using wp_die
- Change template dynamically
- Programmatically detect if wp-cron is disabled?
- Passing nonce at admin menu link
- Prevent third party plugin’s admin page access based on user type
- I have 2 plugins using the same wp_login action hook and one is not working
- Make a plugin page out of influence of the theme’s style
- 400 Bad Request, in wordpress theme development, wp_ajax
- Multiple array for post_content on plugin activation
- Check if the current user is author of first comment
- How do I force a download in the admin area?
- add_action wp_ajax_ not loading in plugin file WP Network
- Configuring Xdebug with docker compose
- Get the current post/page URL with plain permalinks
- ajax multiple Values
- Change Label of custom post type
- Plugin outputs content of posts unbidden!
- I want to encrypt my WordPress plugin
- The plugin generated 3265 characters of unexpected output
- Making a user platform reachable by a qr code on a pin-back-button [closed]