Make WordPress Core


Ignore:
Timestamp:
02/19/2016 09:04:53 PM (9 years ago)
Author:
ocean90
Message:

Styles: Pass the media attribute as an argument to the style_loader_tag filter.

Props sebastian.pisula.
Fixes #34765.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class.wp-styles.php

    r36590 r36592  
    9999         * @since 2.6.0
    100100         * @since 4.3.0 Introduced the `$href` parameter.
     101         * @since 4.5.0 Introduced the `$media` parameter.
    101102         *
    102103         * @param string $html   The link tag for the enqueued style.
    103104         * @param string $handle The style's registered handle.
    104105         * @param string $href   The stylesheet's source URL.
     106         * @param string $media  The stylesheet's media attribute.
    105107         */
    106         $tag = apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-css' $title href='$href' type='text/css' media='$media' />\n", $handle, $href );
     108        $tag = apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-css' $title href='$href' type='text/css' media='$media' />\n", $handle, $href, $media);
    107109        if ( 'rtl' === $this->text_direction && isset($obj->extra['rtl']) && $obj->extra['rtl'] ) {
    108110            if ( is_bool( $obj->extra['rtl'] ) || 'replace' === $obj->extra['rtl'] ) {
     
    114116
    115117            /** This filter is documented in wp-includes/class.wp-styles.php */
    116             $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, $rtl_href );
     118            $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, $rtl_href, $media );
    117119
    118120            if ( $obj->extra['rtl'] === 'replace' ) {
Note: See TracChangeset for help on using the changeset viewer.