style_loader_tag

style_loader_tag

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7

apply_filters('style_loader_tag') is found 2 times:

  • /wp-includes/class-wp-styles.php line 251
    		 * @param string $handle The style's registered handle.
    		 * @param string $href   The stylesheet's source URL.
    		 * @param string $media  The stylesheet's media attribute.
    		 */
    		$tag = apply_filters( 'style_loader_tag', $tag, $handle, $href, $media );
    
    		if ( 'rtl' === $this->text_direction && isset( $obj->extra['rtl'] ) && $obj->extra['rtl'] ) {
    			if ( is_bool( $obj->extra['rtl'] ) || 'replace' === $obj->extra['rtl'] ) {
    				$suffix   = isset( $obj->extra['suffix'] ) ? $obj->extra['suffix'] : '';
    				$rtl_href = str_replace( "{$suffix}.css", "-rtl{$suffix}.css", $this->_css_href( $src, $ver, "$handle-rtl" ) );
    			} else {
    
  • /wp-includes/class-wp-styles.php line 272
    				$media
    			);
    
    			/** This filter is documented in wp-includes/class-wp-styles.php */
    			$rtl_tag = apply_filters( 'style_loader_tag', $rtl_tag, $handle, $rtl_href, $media );
    
    			if ( 'replace' === $obj->extra['rtl'] ) {
    				$tag = $rtl_tag;
    			} else {
    				$tag .= $rtl_tag;
    			}
    

See this hook used in plugins: