If you enqueue your style sheet first you should be able to use wp_add_inline_style afterwards.
function custom_style() {
wp_enqueue_style('your_css', plugin_dir_url( __FILE__ ) . 'style/your_css.css' );
$bg_color = get_option('custom_color');
$custom_css = " body { background-color: {$bg_color}; }";
wp_add_inline_style( 'your_css', $custom_css );
}
This is not tested (just written from mind) and I have never used it in the admin section. Just test it with admin_enqueue_scripts.
Related Posts:
- How Restrict access to admin dashboard by specific static ip?
- Why isn’t admin_notices displaying my text? [Simple Plugin, Beginner]
- WordPress takes too much time (100 seconds) to load – Front end and back end
- WordPress on AWS with ELB
- How to make multiple admin pages for one plugin?
- How can i force wp-admin to use 2-column dashboard layout? [closed]
- WordPress fatal error from php protocol codes
- How can we get this dynamically as this folder may not be by the same name always → wp-admin
- Calling PHP function with AJAX
- WordPress Plugin PHP Not Calling Function
- Is admin section completely customizable in terms of styling?
- Admin login substantially slower on production server
- Allow direct access to files/folders within WordPress to replace wp-admin
- PHP FATAL ERROR
- Consuming an external API in WordPress?
- Is There a WordPress Hook to Filter the Edit Posts View?
- How can I import a class privately into a plugin?
- Removing an admin page added by a 3rd party plugin. Gravity forms in this example
- How to Loop Plugin Option Field Set?
- WordPress admin notice in plugin function
- How to Create a Directory in a Plugin Folder?
- Create plugin that works in background
- Checking for user role in a custom plugin
- White text on white background in TinyMCE when wp_editor is called in WP 3.9
- HELP: Integrating WP with raw PHP code once published button is hit
- Loading class files via autoload method
- How to redirect Old Post URL to new Post and keep Old post Comments?
- Modifying Footnote Plugin for Descriptive Title Attributes
- I would like to use create a function in my custom plugin to tell WP to use a different header
- jQuery function didn’t work in my plugin
- bulk change of image setting “link to” to “link to: image url “
- How to Sort the Favorite Plugins Screen Alphabetically?
- Hide extra menus from WordPress Dashboard
- Make id column as AUTO INCREMENT on plugin activation
- Sending email from inside a plugin using PHP PEAR
- Notepad sticky plugin
- WooCommerce Custom Product to checkout
- How to stop or remove an action being called inside a function of an extended class
- Adding an Options Page to a Plugin
- How do I “get the next 10 posts after post_id == x”?
- All Users > User List > Update User Meta Field Inline
- How to simultaneously access the same MySQL database in the main column and sidebar of WordPress?
- Default WordPress WP Editor removing style tags and html tag
- Adding a new field to the address field type in gravity forms
- Show admin notice on incorrect value on form field
- Customizing NEXTGEN Gallery To link images to pages
- WooCommerce specifc variations for specific user role [closed]
- Nested shortcode functions accessing variable
- Ability to automatically redirect a URL
- Passing Page ID used in Meta Box Creation to JavaScript
- Create a plugin from within WordPress
- Class variables not correct on page
- Call plugin with php function
- What happens when WordPress memory limit is exceeded?
- How do I add $_SESSION[”] to my wordpress page?
- output html on post or page from custom plugin [closed]
- WordPress: Add custom add_filter for custom functions
- Change the layout of action links under the plugin names
- How can i add simple code in only in posts by function.php
- Hide DIV if empty – Plugin Gallery
- Profile / benchmark wordpress on apache?
- How to change layout of shop page in wordpress? [closed]
- Why are plugin settings not all nested in one place?
- Retrieve Plugin Settings and insert into XML string
- WordPress Stats Plugin: Display Post Views [closed]
- Pagination not working
- exec-PHP shows output at bottom of page
- How to fix these PHP Warnings with the “Feed JSON” plug-in?
- need to find duplicated meta value in custom filed and view the posts that have the same value
- Can I disable xml-rpc by setting it to false?
- Push Contact form 7 variable to front end after submission
- Add a parameter at the end of the url and prettify
- Share my WordPress plugin for updating how?
- How can I change page content for good once a button is pressed?
- Google Maps for Woocommerce Checkout
- working code, not working – Plugin Dev
- Add two row of code to the public static function init of a plugin
- WordPress Admin login redirect to homepage
- Get and Update Most Meta Value as an array in HTML form
- WordPress filter from custom table is not working properly
- Configuring default woo commerce login with modal popup
- register_activation_hook doesn’t fire at all
- My ajax request don´t work and return 0
- How can I remove this sidebar from my Search Results page?
- Create csv file in plugin
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- conditional tags for the output of a plugin
- Can’t insert files in other inputs
- How to tweak a plugin without preventing it from updating
- Place max_execution_time in plugin [closed]
- Ajax in wordpress [duplicate]
- Notifications Bar on home page only
- wordpress illegal string offset ‘parameter’ error
- Function not being called on form submit, only blank admin-post.php page
- cURL External API request displays content above other content on page
- WordPress Convert queries to slashes using function.php
- Getting table to format properly in RSS feed emails
- Getting table to format properly in RSS feed emails
- PHP Deprecated function Optional parameter $function
- Plugin for better Backend Search? [closed]