apply_filters( 'style_loader_src', string $src, string $handle )

Filters an enqueued style’s fully-qualified URL.


Parameters Parameters

$src

(string) The source URL of the enqueued style.

$handle

(string) The style's registered handle.


Top ↑

Source Source

File: wp-includes/class.wp-styles.php

View on Trac



Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by Ravi Makwana
    // Remove query string from static CSS files 
    function remove_query_string_from_static_files( $src ) {
        if( strpos( $src, '?ver=' ) )
            $src = remove_query_arg( 'ver', $src );
        return $src;
    }
    add_filter( 'style_loader_src', 'remove_query_string_from_static_files', 10, 2 );
    

You must log in before being able to contribute a note or feedback.