__DIR__
returns the current file system path, not a URL. So the resulting stylesheet will not be a valid URL, and will not have https://
, causing the insecure content warning.
To get the URL for a stylesheet in your plugin, you need to use plugins_url()
:
wp_register_style( 'estilo', plugins_url( 'assets/css/estilo.css', __FILE__ ) );
The use of __FILE__
here is described in the documentation for the function:
A full path to a file inside a plugin or mu-plugin. The URL will be
relative to its directory. Typically this is done by passing__FILE__
as the argument.
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?
- How to add sub-menu to a menu generated by wp_nav_menu by using plugin
- 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
- What is better way to use Bootstrap inside admin panel?
- wp_enqueue_style built in styles
- 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?
- 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?
- Is there no admin ui guide for 4.x?
- Correct check for any admin page with editor
- How to remove default style of header in wordpress metabox
- CSS not affecting widget output
- How can I avoid conflicts between plugin and theme?
- 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
- 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
- Apply styles to blockquote element with the WYSIWYG editor
- Completely isolate a plugin view so it doesn’t load the theme
- Does WordPress default CSS have Grids?
- How to insert HTML/CSS/JS into my iframe plugin?
- How To Protect Plugin Display From Being Affected By Theme’s CSS
- Load stylesheet in edit category page?
- CSS not being applied using wp_enqueue_style
- WordPress Plugin Authoring question about jquery and css
- How to add some basic inline CSS using existing plugin or theme?
- Why my theme’s css not working on another site
- WordPress plugin development theme issue
- Why does theme’s reset CSS have higher precedence of plugin’s CSS?
- Twenty-seventy theme remove additional CSS from head
- How to customize the size of Featured Images or Post Thumbnails in WordPress?
- 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
- Best practice to include custom user styles in widgets
- How to create A – Z List with pictures?
- how to add contact form 7 shortcode in javascript variable
- How do I programatically insert a new menu item?
- When would I use either function for plugins?
- Test to see if jQuery or Prototype is queued by another plugin?
- jQuery in header or footer
- Notice: _usort_terms_by_ID is deprecated since version 4.7.0! Use wp_list_sort instead
- How to add a new plugin page under desired Options page?
- Plugin screenshots not showing in the repository
- How to make WordPress use non-greedy shortcode parsing?
- Multiple Parameters for a Shortcode
- Pages 404 in wordpress
- How to properly load text domain of custom mu plugin
- Post from front-end with post types, categories and taxonomies
- product-attribute-slug-is-too-long-28-characters-max
- Multiple entries in get_option results? or why is _multiwidget set to 1?
- Check if I am in the Admin Panel (wp-admin)?
- Fully automated theme install and activation via a plugin
- Using Ajax call in jQuery doesn’t work in widget
- Using Checkboxes on Plugin Options Page for Custom Plugin
- Generating User(s) with Settings API
- How to redirect to action on custom page within admin section
- How to convert this cURL to wp_remote_get?
- Including a JS source with an admin page
- Should action callbacks start with a verb?
- How insert negative values in Gutenberg box-control
- What filter should I use to insert a button inside on Media>Add New
- is user logged in not working
- Override class inside $atts shortcode_atts in WordPress
- How to use a hook to override an update_post_meta call in a plugin?
- External Authentication, session_tokens not destroyed on logout
- How to programmatically add a custom template that appears in Site Editor from a plugin?
- In woocommerce cart item we can add custom text but how can i add custom link? [closed]
- Is it possible to restrict all admin pages except theme customisation and storefront using plugin?
- Updating Woocommerce Settings API when WordPress Settings API saved and vise versa
- Secure REST with nonce works only when not logged
- template_include filter does not render the custom template
- How to give a download link to a .csv file from the custom plugin?
- How to set a cookie for logged in users to md5($user->ID . “my_secret”)?
- WordPress plugin enqueue scripts working for js, but not css files
- First and last name fields not filled when using wp_insert_user
- my basic php code producing unexpected results
- How to find list of all functions bind to a particular hook from my plugin?
- How to create dynamic content with get_post_meta?
- How to trigger WooCommerce user profile edit change?
- Return raw image proxy for wordpress plugin
- Stop unauthorised file access
- Changed media upload path for plugin, but generates error & shows wrong url
- How to pass a more variable with page/subpage in Wordprees URL?
- Use a page as a template for a custom post type
- Dynamic sidebar areas not working on the Theme Customizer
- Merge Codes using redux framework
- Getting Plugin to read all script files