Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: style_loader_tag

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
78
79           /**
80            * Filter the HTML link tag of an enqueued style.
81            *
82            * @since 2.6.0
83            *
84            * @param string         The link tag for the enqueued style.
85            * @param string $handle The style's registered handle.
86            */
87           $tag = apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-css' $title href='$href' type='text/css' media='$media' />\n", $handle );
88           if ( 'rtl' === $this->text_direction && isset($obj->extra['rtl']) && $obj->extra['rtl'] ) {
89                if ( is_bool( $obj->extra['rtl'] ) || 'replace' === $obj->extra['rtl'] ) {
90                     $suffix = isset( $obj->extra['suffix'] ) ? $obj->extra['suffix'] : '';
91                     $rtl_href = str_replace( "{$suffix}.css", "-rtl{$suffix}.css", $this->_css_href( $obj->src , $ver, "$handle-rtl" ));
92                } else {
93                     $rtl_href = $this->_css_href( $obj->extra['rtl'], $ver, "$handle-rtl" );
94                }
95
96                /** This filter is documented in wp-includes/class.wp-styles.php */
97                $rtl_tag = apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-rtl-css' $title href='$rtl_href' type='text/css' media='$media' />\n", $handle );
98
99                if ( $obj->extra['rtl'] === 'replace' ) {
100                     $tag = $rtl_tag;
101                } else {
102                     $tag .= $rtl_tag;
103                }
104           }
105
106           if ( isset($obj->extra['conditional']) && $obj->extra['conditional'] ) {