WordPress filter hook · part of WordPress core
style_loader_src
A WordPress core filter that 25 plugins also fire themselves, running on 599K+ sites between them.
“Filter the style source URL”
How to use style_loader_src
It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'style_loader_src', function( $style, $name ) {
// Change $style here.
return $style;
}, 10, 2 );Argument names come from LH Zero Spam's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
This hook is fired by WordPress core too. Official reference on developer.wordpress.org →
25 plugins that fire style_loader_src
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
Page Optimize300,000+ installs
apply_filters( 'style_loader_src', $obj->src, $obj->handle )concat-css.php:127 -
Jetpack Boost200,000+ installs
apply_filters( 'style_loader_src', $obj->src, $obj->handle )app/lib/minify/class-concatenate-css.php:78 -
SecuPress with Simple SSL40,000+ installs
apply_filters( 'style_loader_src', $style_url, 'secupress' )free/classes/scanners/class-secupress-scan-discloses.php:189 -
NotificationX30,000+ installs
apply_filters( 'style_loader_src', $src, $handle )includes/FrontEnd/FrontEnd.php:562 -
PWA20,000+ installs
apply_filters( 'style_loader_src', $url, $handle )integrations/class-wp-service-worker-styles-integration.php:77 -
Swift Performance Lite6,000+ installs
apply_filters( 'style_loader_src', home_url(), 'dummy-handle' )modules/asset-manager/asset-manager.php:453 -
Powered Cache3,000+ installs
apply_filters( 'style_loader_src', $obj->src, $obj->handle )includes/classes/Optimizer/CSS.php:79 -
MinQueue200+ installs
apply_filters( 'style_loader_src', $src, $handle )class.minqueue.php:355 -
LH Zero Spam100+ installs
apply_filters( 'style_loader_src', $style, $this->name )includes/lh-register-file-class.php:152 -
LH Sortable Tables90+ installs
apply_filters( 'style_loader_src', $style, $this->name )includes/lh-register-file-class.php:142 -
LH Web Application10+ installs
apply_filters( 'style_loader_src', $style, $this->name )includes/lh-register-file-class.php:98 -
LH Javascript Error log10+ installs
apply_filters( 'style_loader_src', $style, $this->name )includes/lh-register-file-class.php:142 -
LH Fresh Content10+ installs
apply_filters( 'style_loader_src', $style, $this->name )includes/lh-register-file-class.php:152 -
LH Paragraph Ids10+ installs
apply_filters( 'style_loader_src', $style, $this->name )includes/lh-register-file-class.php:152 -
ShahCalc10+ installs
apply_filters( 'style_loader_src', $src, 'shahcalc-calculator' )includes/class-shahcalc-shortcode.php:55 -
Dashboard for Woo10+ installs
apply_filters( 'style_loader_src', $src, $handle )includes/class-webangonwd-ajax.php:155 -
Synced Pattern Popups10+ installs
apply_filters( 'style_loader_src', $src, $handle )includes/class-sppopups-plugin.php:802 -
AdFever for WordPress10+ installs
apply_filters( 'style_loader_src', $src, $handle )lib/wp-compat/class.wp-styles.php:83 -
LH Related Posts by TaxonomyFewer than 10 installs
apply_filters( 'style_loader_src', $style, $this->name )includes/lh-register-file-class.php:152 -
LH CSS Dates and TimesFewer than 10 installs
apply_filters( 'style_loader_src', $style, $this->name )includes/lh-register-file-class.php:152 -
LH SignupFewer than 10 installs
apply_filters( 'style_loader_src', $style, $this->name )includes/lh-register-file-class.php:152 -
Rooster LMSFewer than 10 installs
apply_filters( 'style_loader_src', self::src( $styles, $src, $item->ver ), $handle )includes/CourseBuilder/PortalEditor.php:271 -
ZetaLine CookieFewer than 10 installs
apply_filters( 'style_loader_src', $href, $handle )includes/class-script-manager.php:476 -
LH LocalforageFewer than 10 installs
apply_filters( 'style_loader_src', add_query_arg('ver', $style->ver,$style->src), $this->name )includes/lh-register-file-class.php:100 -
SoloAutomationFewer than 10 installs
apply_filters( 'style_loader_src', $href, $handle )includes/services/class-soloautomation-elementor-performance.php:119
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.