You can actually put a directory for your style sheet right in the mu-plugins directory. I called mine “my-companies-assets”. The tricky part is calling your styles into your mu-plugin. In your main MU plugin file…
// Setup MY AWESOME MU plugin url
// This will help if you switch to multisite some day
if (is_multisite()) {
define('MY_AWESOME_MU_PLUGIN_URL', network_site_url('/wp-content/mu-plugins', 'relative'));
} else {
define('MY_AWESOME_MU_PLUGIN_URL', content_url('/mu-plugins'));
}
// Then you can just use wp-enqueue_style like normal
wp_enqueue_style( 'my-mu-styles', MY_AWESOME_MU_PLUGIN_URL.'/my-companies-assets/styles.css', array(), 1 );
/**
* The rest of your plugin code
* goes here
*/
Related Posts:
- Is there any plugin development framework
- Plugin – create a page without it appearing in the side menu
- Is wp-content/install.php a Drop-in?
- Handling results from data hooked into admin_post
- Using wp_filesystem in Plugins
- How to write testable classes in WordPress
- get_template_part from plugin
- Edit or Remove Plugin .htaccess Using The Admin Panel
- WordPress scheduled task is called but not executed
- How to create collections that are edited in admin?
- How can i list current author’s categories?
- How to use filter hook ‘post_updated_messages’ in coherence with action hook ‘save_post’
- wp_mail not recognizing cc and bcc headers
- How can I call “preview post” from wp_remote_get with authentication?
- When is it too late to call the action wp_enqueue_scripts?
- Use js script from one plugin in another plugin
- Rest Api How to get results of child categories with one api call
- Plugin Loading Scripts and Styles on Every Page – Even when not being used
- Build dynamic page from cURL (HTML page) response with plugin
- How to store accumulate multiple option values in a single array using Options_API
- Add Post and Comments menu no longer visible
- template_redirect for single posts w/ custom fields
- can I prevent WP users (even admin) from deleting custom categories?
- How to deal with equal & similar arguments for a function?
- What parameter should I pass to wp_enqueue_style to depend on the themes stylesheet?
- How do I obtain a list of categories assigned to the current post?
- Modify hard-coded conditionals for roles to custom roles
- I’m designing a plugin to create database indexes. Suggestions?
- need to get user ID after a user logs in
- Callback is not called in add_settings_field() when passed as part of an array, but recognises that it’s there. It’s passed Class to Class using OOP
- Plugin translations not installed but… strings are translated!
- Secure Pages Best Practice
- Plugin for Android Marketplace downloads?
- Does wp_login only trigger before an user signs in into the admin panel?
- How to access noticeOperations from withNotices
- Putting a resized image into media library with wp_get_image_editor(
- Using ReactJS in the WordPress admin for plugin development
- How to use github to update my plugin
- Thickbox doesn’t respect dimensions when used in admin [duplicate]
- wp_nonce_field displaying twice
- jQuery in WordPress Plugin
- Function/Class to list categories with checkboxes
- Is it possible to enable and disable wp debug from functions.php?
- Default settings aren’t used
- Remove an action by extending class and replacing it
- making a plugin that moves other plugins wp_head actions to wp_footer
- Best way to include and use Zoho SDK in a wordpress plugin
- How to change WooCommerce loop product title HTML output in single product page and archive page
- Is hint for translator compulsory while internationalizing a string containing variables?
- Settings API: Setting default option via ‘get_option’ fails
- Setting a JSON web token from a secondary api as a secure cookie on WordPress
- How to redirect to login page when user not loggedin on a particular page
- How to use nonce
- WP Still Generating 150×150 Thumbnail Size Even After Un-Setting Small Size in Functions.php
- How do I validate extra pin field on my WordPress login form page?
- How to create a wordpress widget that dynamically changes according to the page
- Does WordPress default CSS have Grids?
- Plugin can’t be activated [closed]
- Plugin to create Posts and Forums then choose category and parent forum
- CSS not being applied using wp_enqueue_style
- Adding Permalink to Slides with ‘Simple Nivo Slider’ plugin?
- How to add a new taxonomy link to the admin menu
- Many Single Sites, One Plugin directory – adjust plugins_url()
- insufficient permissions; coding an action for plugin governed by custom capability
- Make a php array load faster
- Count products with custom metadata field in an order
- Include external po file for 3th party plugin to theme
- Adding the image selector/uploader to an admin back page
- setTimeout not working in jquery
- Woocommerce Product finder feature on home page
- How do I show the HTML descrption in wordpress photo gallery for my individual gallery pages?
- Javascript scroll eventHandler only working when I’m logged in in WordPress
- Adding and handling custom settings tab to fusion element
- WordPress Reset password Strength set to medium
- Add language localisation to javascript alert?
- redirect_to how to make it simply work with get parameter or similar?
- cancel place order proccess
- How I can give access to my custom plugin for editor roles user?
- Testing Plugins for Multisite
- Problem with baseurl and interaction with plugin
- Why setcookie function redirecting to home page in wordpress?
- Should all roles be allowed CRUD operation on the database?
- Associating special meaning with user id 0
- Filter get_user_by instead of replace function
- WP: adding Javascript to specific woo commerce pages
- Downloading Generated XML File
- Calling dynamic_sidebar in plugin gives error
- How to add chunk of php, html, and sql code to variable an append to $content
- edit-tags.php in plugin admin menu hides when is the active page
- How to create a custom search form and handler?
- Best way to handle a form post in plugin
- Method to retrieve category names and IDs only as an array?
- How To Remove The Filter That Adds JetPack Related Content To Dom [closed]
- Fixing plugin for wpdb::prepare
- Send Webhook when post-status is publish or trash
- Using “add_image_size” to register custom image sizes inside plugins not working
- How do I access the contents of WordPress Classic editor in admin area with JavaScript?
- Need someone to help you want to manage points for members to code interface functions? thank you
- WordPress plugin boilerplate AJAX functionality
- Run different permission_callback depending on HTTP method of custom REST API endpoint