The way to enqueue admin styles and scripts in targeted pages is explained here:
Difference between do_action(‘admin_enqueue_scripts’, $hook_suffix) and do_action(“admin_print_styles-$hook_suffix”) syntax
The Category page is the same as the Tag page, /wp-admin/edit-tags.php
. So, an extra check is needed and in this case using the global variable $current_screen
.
add_action( 'admin_print_styles-edit-tags.php', function(){
global $current_screen;
// Not categories, do nothing
if( 'edit-category' != $current_screen->id )
return;
// Debug
echo "<script>alert('$current_screen->id')</script>";
// wp_enqueue_style() call here
});
Related Posts:
- How do I add CSS options to my plugin without using inline styles?
- Is it ever okay to include inline CSS in plugins?
- add_action hook for completely new post?
- How to add sub-menu to a menu generated by wp_nav_menu by using plugin
- How can i list current author’s categories?
- How to Make a Category Always Selected?
- How to prevent loading of all plugin’s resources?
- What is the best way to provide plugin users with a way to customized the styles
- anything like add_meta_box for categories?
- Calling clean_term_cache() fails when called in the same plugin that creates terms, succeeds when called separately?
- Missing “category_children” option when dynamically creating categories via a plugin
- Can we create a category list page in WordPress?
- What is better way to use Bootstrap inside admin panel?
- wp_enqueue_style built in styles
- prevent post to have multiple categories in my plugin
- Backslashes being stripped from CSS
- Dequeue theme stylesheets but keep widget styling on custom page template
- How to check if a stylesheet is already loaded?
- how to include javascript file and css file in wordpress
- How can I add a CSS rule to edit.php?
- Remove Internal Style Sheet if no Value Provided?
- Show add_meta_box by selecting a specific category
- How do I include background images in my stylesheets in a plugin?
- What parameter should I pass to wp_enqueue_style to depend on the themes stylesheet?
- Which are the hooks run before/after when a category’s deletion?
- how do you prevent showing a particular category on the admin dashboard for specific user roles?
- Is there no admin ui guide for 4.x?
- Is it possible to change a term slug before being saved to the database?
- Correct check for any admin page with editor
- wp_insert_category() setting the ‘cat_ID’ gives not array error
- Send push when new post is published in a certain category
- How do I get the sub categories of the parent when in a sub category?
- How to remove default style of header in wordpress metabox
- Filter Categories widget to allow custom sorting?
- CSS not affecting widget output
- How can I avoid conflicts between plugin and theme?
- Redirect to another page using contact form 7? [closed]
- Plugin Development/ Stop CSS clashes.
- Can’t change the style of a submit input type? [closed]
- Make a plugin page out of influence of the theme’s style
- Function/Class to list categories with checkboxes
- Distributing Frontend Assets with Plugins
- My stylesheets are not enqueuing
- Custom Plugin – CSS works, JS doesn’t
- Are there any official or unofficial guidelines for the styling of a widget?
- Proper way to include stylesheet for panels
- How can I show posts for a single category?
- Apply styles to blockquote element with the WYSIWYG editor
- Check if post belongs to any category
- How to display the categories on page using shortcode?
- Styles don’t load correctly. Insecure content
- How to display the category id along with category name on categories list?
- Completely isolate a plugin view so it doesn’t load the theme
- add_action pre_term_description vs. pre_category_description
- Does WordPress default CSS have Grids?
- How to show parents of current page category, excluding the category?
- WP Dropdown Categories, display subcategories but not grandchildren categories?
- How to insert HTML/CSS/JS into my iframe plugin?
- How To Protect Plugin Display From Being Affected By Theme’s CSS
- How to relate the Category to user?
- CSS not being applied using wp_enqueue_style
- WordPress Plugin Authoring question about jquery and css
- How to exclude categories from get_categories() select list inside a widget admin panel
- How to Show Category List With Corresponding Links?
- How to add some basic inline CSS using existing plugin or theme?
- Exclude Woocommerce Product Category From Sitemap
- Why my theme’s css not working on another site
- WordPress plugin development theme issue
- How to show only the last two categories in a menu?
- Why does theme’s reset CSS have higher precedence of plugin’s CSS?
- Determine if term is Category or Tag
- Twenty-seventy theme remove additional CSS from head
- How to check category name available or not
- delete category on plugin deactivation wordpress
- Post is uncatagorized in publish_post action
- Hide post by ‘post_category’
- Woocommerce product not appearing in category list page when created programatically [closed]
- Yoast and another plugin
- How to customize the size of Featured Images or Post Thumbnails in WordPress?
- Making Woocommerce optimized for more than 500k products
- Add a new tag based on the category name in the publish event
- Publish, Save Draft and Preview buttons do not work after being moved with jQuery
- Unable to link CSS file
- How can I add the Post ID to Class Name in Jquery?
- Let user override plugin CSS
- Creating an archive page listing external data
- How can i call from custom fields to the category editor?
- Best practice to include custom user styles in widgets
- What method would I use to show an image in between X amount of posts on category archive? [duplicate]
- filter on get_posts efficiently
- How to create A – Z List with pictures?
- How to get recent one post from each category on home page?
- how to add contact form 7 shortcode in javascript variable
- Where to enqueue stylesheets for plugin?
- Deletion of shared options using uninstall.php
- Plugin Settings not Saving on Ajax re-ordered table
- How to fetch all images from a WordPress draft using PHP?
- Strange Situation When Try To Retrieve Github Gist Using wp_remote_get
- jQuery does not enqueue for my purpose… (before an inline script in the footer)
- insert query on a custom table using ajax with jQuery plugin Jeditable