__DIR__
is rather new and not always supported. Use dirname( __FILE__ )
.
plugins_url()
is using …
$folder = dirname(plugin_basename($plugin));
… so yes, it is safe.
Just use plugins_url( 'subfolder/file.css', dirname( __FILE__ ) )
Related Posts:
- plugins_url(”,__FILE__) != WP_PLUGIN_URL with sym links
- Are there functions for file paths, instead of just urls
- Insert Current URL into MailTo link in wordpress
- How to call images from your plugins image folder?
- Posts URL structure like site.com/category/the-post-title
- Add forward slash on categories url (serve one version of a url)
- Security in WordPress plugin development
- URL rewriting for WordPress Network (Multisite) subsite
- plugin_dir_url() adds path to url
- Dropzone.js and wordpress plugin
- plugins_url() incorrectly returns a url with www subdomain
- URL parsing – what is it?
- Components used in Themes and Plugins: How to get file URL?
- Is there a way to dynamically get URL as a path to plugin root, not a local path?
- plugins_url() incorrectly returning wp-include directory
- Why WordPress plugin url ajax doesn’t work?
- Access bloginfo, get_option, and plugins_url from a non-core php file
- check if a file in a plugin folder exists from a locale installation
- What’s wrong with my use of plugin_url()?
- plugins_url() works everywhere but wp_reqister_script()
- Getting back a permalink from custom url
- 404 when enqueue_script using plugin_url
- php – Plugin/theme relative PATH/URI
- Add URL Rewrite Rule To WordPress
- Sharing /wp-content/ folder between different WordPress Multisite installs?
- How do I link an image in my plugin so it displays on WordPress?
- reCAPTCHA on page template without plugin
- Make custom system url
- Fail on admin_enqueue_scripts when I try it to upload a CSS file to my WordPress Plugin
- WooCommerce or any other plugin: Deliver JS and CSS through CDN without using a Plugin
- plugins_url not returning correct directory
- Change default url to plugin custom post type
- Template included with plugin doesn’t return all posts for custom taxonomy
- add custom entries to menu options
- How to tell if a script is being executed from a plugin, a theme or a child theme in WordPress?
- Widget redirecting to home page
- How to use plugins_url() inside PHP stylesheet file [duplicate]
- How to make a rest style plugin?
- Change from blogger to wordpress