WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/27/2008 12:18:38 PM (12 years ago)
Author:
azaozz
Message:

Faster hide-if-no-js, if-js-closed, etc. needed when loading scripts in the footer.

File:
1 edited

Legend:

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

    r9002 r10258  
    4040
    4141        $href = $this->_css_href( $this->registered[$handle]->src, $ver, $handle );
     42        $rel = isset($this->registered[$handle]->extra['alt']) && $this->registered[$handle]->extra['alt'] ? 'alternate stylesheet' : 'stylesheet';
     43        $title = isset($this->registered[$handle]->extra['title']) ? "title='" . attribute_escape( $this->registered[$handle]->extra['title'] ) . "'" : '';
    4244
    4345        $end_cond = '';
     
    4749        }
    4850
    49         echo apply_filters( 'style_loader_tag', "<link rel='stylesheet' href='$href' type='text/css' media='$media' />\n", $handle );
     51        echo apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle' $title href='$href' type='text/css' media='$media' />\n", $handle );
    5052        if ( 'rtl' === $this->text_direction && isset($this->registered[$handle]->extra['rtl']) && $this->registered[$handle]->extra['rtl'] ) {
    5153            if ( is_bool( $this->registered[$handle]->extra['rtl'] ) )
     
    5456                $rtl_href = $this->_css_href( $this->registered[$handle]->extra['rtl'], $ver, "$handle-rtl" );
    5557
    56             echo apply_filters( 'style_loader_tag', "<link rel='stylesheet' href='$rtl_href' type='text/css' media='$media' />\n", $handle );
     58            echo apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle' $title href='$rtl_href' type='text/css' media='$media' />\n", $handle );
    5759        }
    5860
Note: See TracChangeset for help on using the changeset viewer.