filemtime() warning when enqueuing style within plugin

I’m receiving the following filemtime() warning: Warning: filemtime(): stat failed for https://testing.local/wp-content/plugins/test-social-icons/css/style.css in /app/public/wp-content/plugins/zoo-social-icons/zoo-social-icons.php on line 29 Here’s how I’m enqueuing the stylesheet within my plugin: function test_styles_scripts() { $dir = plugin_dir_url(__FILE__); wp_enqueue_style( ‘test-style’, $dir . ‘css/style.css’, array(), filemtime( $dir . ‘css/style.css’ ) ); } add_action( ‘wp_enqueue_scripts’, ‘test_styles_scripts’ ); The stylesheet is correctly enqueuing. Why … Read more

How to dequeue wp_get_custom_css in Twenty Twenty Theme

How to remove Additional CSS from loading. It loads as internal style sheet on every page. I am doing this but it is not working. if I print_r(wp_get_custom_css()); It shows the same css. I want to disable it to load. add_action( ‘wp_enqueue_scripts’, ‘mywptheme_child_deregister_styles’, 11 ); function mywptheme_child_deregister_styles() { wp_dequeue_style( ‘wp-custom-css’ ); } 1 Answer 1 … Read more

.editor-styles-wrapper overriding my block styles in Gutenberg

I’m working on my first theme built from custom gutenberg blocks. I’ve managed to register blocks and enqueue their specific stylesheets, but I’m running into one issue that’s kind of a pain. A lot of my blocks override global styles from my style.css file. However, when I enable editor styles, the .editor-styles-wrapper class is superseding … Read more

Register script/style: Is it possible to customize the version query string via plugin?

Expanding on the question in the title: I would like to find a way (via a plugin) to use timestamps for the JS and CSS file version query strings that are output with wp_register_style and wp_register_script. I know this can be easily modified in the calls themselves, and I do it this way currently: $style_mtime … Read more

How to detect if a function has been fired on any page so scripts/styles can be loaded conditionally

I’m building a small gallery plugin and I’d like to only load scripts/styles onto the page IF the gallery has been loaded via the template tag. The template tag can take a post ID parameter when used to call a post’s gallery from wherever you need within the theme. I know how to do this … Read more