So, is there a way to achieve this?
Indeed, there is – I’m doing it in my own optimization plugin – but it’s going to involve more work than you might first suspect.
- Use
add_action()to register a hook that triggers on the front-end to output a JSON-encoded array of registered styles - Use the HTTP API (or an AJAX call) to make a request against the front-end to trigger that hook
- Read the results of your HTTP API call from your
/wp-admin/script
There are a number of additional considerations if you want to cover all your bases here, but that should be everything you need to get started.
Related Posts:
- Using tabs for wordpress plugin
- How to activate/deactivate menu tab and keep the same id?
- Adding a Taxonomy Filter to Admin List for a Custom Post Type?
- Best way to overide plugin CSS?
- How can I use WordPress functions in my stylesheet?
- I found this in a plugin. What does it do? is it dangerous?
- Disable /wp-admin/plugin-install.php
- How to Add a Third Level Sub Menu to the WordPress Admin Menu
- Restricting a Plugin to Only Load its CSS and JS on Selected Pages?
- How to export comments in WordPress?
- How to eliminate weird 404 errors in wp-admin?
- How do I cleanly override a plugin’s CSS with a child theme?
- How to stop showing admin notice after close button has been clicked
- Where are plugins located
- Why does wp_enqueue_style() in plugin not load stylesheet?
- Admin menu as submenu from another plugin
- Is There a WordPress Hook to Filter the Edit Posts View?
- how to include other plugins css files in a shortcode?
- Why does WordPress require a ftp server to be running on the webserver to transfer plugins?
- Reordering themes in admin panel
- WordPress Admin is displaying Not Available
- Removing an admin page added by a 3rd party plugin. Gravity forms in this example
- Is there any record of installed plugins in the database?
- How can I reduce the amount of files loaded/included per plugin?
- How can I dequeue a Plugin Stylesheet?
- Add content to /wp-admin/plugin-install.php admin screens
- Best way to manage a lot of pages in Wp Admin [closed]
- Plugin: How to make links in admin page open up inside of the admin panel
- Custom admin column disappearing when using Quick Edit [duplicate]
- WordPress admin notice in plugin function
- Using standard backend elements in Plugin
- How to remove/hide action links cluttering under specific plugins’ names
- How do I add to the list table a filter?
- Getting Custom Post Type content from main-site of a Multisite
- Adding Visibility Options
- Plugin Development: WordPress processes twice on post update. How to skip process on the first?
- Override CSS settings of plugins
- How can I make content disappear when a user logs in?
- Add CSS animation as Preloader to WordPress
- Best way to inject css into admin_head in plugins?
- how to not show plugin in admin area
- wp_enqueue_style in Plugin [duplicate]
- Quote rotator in the sidebar
- Styles and Scripts, Selectively enqueue across entire site
- Make the css of the widget overwrite theme css
- “Are you sure you want to do this?” when deactivating all plugins in WordPress 4.3.1 [closed]
- How to make a WP admin button/menu similar to Jetpack Notifications?
- How can I enqueue a style only when a particular widget is active?
- WordPress Plugin Look & Feel
- Add CSS class to add-to-cart button, Woocommerce [closed]
- Getting “Fatal error: Call to undefined function wp_cache_get() in option.php” after updating a cache plugin [closed]
- How to load all plugins CSS after child theme CSS?
- I need to generate the CSS for my plugin from a function, how do i map a request to a function in the front-end?
- How do I register a stylesheet inside a WordPress widget?
- Prevent CSS/JS loading when plugin is not used
- How Restrict access to admin dashboard by specific static ip?
- Override Theme CSS with CSS from a plugin
- Styling readme.html in plugin?
- Unable to load stylesheets and scripts to plugin settings page
- Layout shop page: resize images and columns
- How extend shortcode default values for a plugin?
- Questions about brute force attacks on the admin username, coming from amazon IP addresses
- wp_enqueue_style specifics for overwriting plugin styles
- Why would WP-CLI and WP Admin show different list of plugins with updates?
- Edits to plugin not taking effect
- How to override my plugin’s php classes with duplicates that are in my child theme folder
- How could I execute my plugin just in frontend (not in backend)
- Is it possible to use Snap Scrolling? [closed]
- Can’t see login page after migration
- Image resizing on home page (product category) [closed]
- Custom height/width for thickbox in WP Backend
- Hide Theme options and Customize Admin menu
- Making menu link open in new tab?
- After activating a Plugin, /wp-admin is no longer accessible
- Weird problems after recovery from security breach
- How can I create a plugin installation link?
- Cannot access wp-admin after disabling all plugin
- W3 Total Cache: Load CSS asynchronously for better PageSpeed score? [closed]
- Function to prevent users from trashing comments
- How to Sort the Favorite Plugins Screen Alphabetically?
- Hide extra menus from WordPress Dashboard
- How do I write into a file (css)
- How to provide a plugin which requires CMB2 (plugin dependencies)?
- ‘wp_login’ action hook not working with wp-login.php file
- ‘Customize’ button in admin bar for CSS
- Why isn’t “background-image: url”working with Bootstrap carousel on WP?
- How to add page using HTML, CSS and JS?
- How to generate CSS from a shortcode within a plugin
- 404 Error on Activate / Deactivate Plugin
- Why isn’t admin_notices displaying my text? [Simple Plugin, Beginner]
- Add stylesheets and js to template files when shortcode is used
- Custom CSS for plugin form
- How do I modify the position of a plugin?
- Plugin upload to install
- WordPress takes too much time (100 seconds) to load – Front end and back end
- WordPress on AWS with ELB
- Change the backend language of a single plugin
- plugin style conflicts, how to override? [closed]
- Is there an earlier hook than login_head or login_enqueue_scripts?
- How to disable CSS rule in Twentythirteen style.css?