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
- How do I programatically insert a new menu item?
- How to tell if an option has been created vs an empty option?
- jQuery in header or footer
- Notice: _usort_terms_by_ID is deprecated since version 4.7.0! Use wp_list_sort instead
- How to make WordPress use non-greedy shortcode parsing?
- WP Cron doesn’t save or in post body
- Pages 404 in wordpress
- Multiple entries in get_option results? or why is _multiwidget set to 1?
- Metabox Not Showing on Custom Post Type But On Pages and Post
- Using Checkboxes on Plugin Options Page for Custom Plugin
- Generating User(s) with Settings API
- Processing shortcodes in groups (separated by line breaks)?
- Including a JS source with an admin page
- Should action callbacks start with a verb?
- How insert negative values in Gutenberg box-control
- What filter should I use to insert a button inside on Media>Add New
- How to use a hook to override an update_post_meta call in a plugin?
- External Authentication, session_tokens not destroyed on logout
- How to programmatically add a custom template that appears in Site Editor from a plugin?
- Secure REST with nonce works only when not logged
- template_include filter does not render the custom template
- How to set a cookie for logged in users to md5($user->ID . “my_secret”)?
- WordPress plugin enqueue scripts working for js, but not css files
- my basic php code producing unexpected results
- get_plugins() is not give plugin list after performed delete_plugins()
- Referencing files in JavaScript in WordPress Plugin
- Creating a WP plugin and having issues linking CSS stylesheet within functions
- What happens/fires when you select a block in the editor?
- How to hide/remvoe unnecessary field/section in post edit section ( Dashboard )
- Change Front page displays settings conditionally when user is online
- How to enqueue an external Javascript file to Frontpage footer
- Woocommerce Custom Checkout
- get_users() not returning all users in site
- Need someone to help you want to manage points for members to code interface functions? thank you
- Run different permission_callback depending on HTTP method of custom REST API endpoint