Changeset 7976 for trunk/wp-includes/class.wp-styles.php
- Timestamp:
- 05/21/2008 11:24:23 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class.wp-styles.php
r7970 r7976 4 4 var $base_url; 5 5 var $default_version; 6 var $text_direction = 'ltr'; 6 7 7 8 function __construct() { … … 22 23 $media = 'all'; 23 24 24 $src = $this->registered[$handle]->src; 25 if ( !preg_match('|^https?://|', $src) ) { 26 $src = $this->base_url . $src; 25 $href = $this->_css_href( $this->registered[$handle]->src, $ver, $handle ); 26 27 $end_cond = ''; 28 if ( isset($this->registered[$handle]->extra['conditional']) && $this->registered[$handle]->extra['conditional'] ) { 29 echo "<!--[if {$this->registered[$handle]->extra['conditional']}]>\n"; 30 $end_cond = "<![endif]-->\n"; 27 31 } 28 32 29 $src = add_query_arg('ver', $ver, $src); 30 $src = clean_url(apply_filters( 'style_loader_src', $src )); 33 echo apply_filters( 'style_loader_tag', "<link rel='stylesheet' href='$href' type='text/css' media='$media' />\n", $handle ); 34 if ( 'rtl' === $this->text_direction && isset($this->registered[$handle]->extra['rtl']) && $this->registered[$handle]->extra['rtl'] ) { 35 if ( is_bool( $this->registered[$handle]->extra['rtl'] ) ) 36 $rtl_href = str_replace( '.css', '-rtl.css', $href ); 37 else 38 $rtl_href = $this->_css_href( $this->registered[$handle]->extra['rtl'], $ver, "$handle-rtl" ); 31 39 32 echo "<link rel='stylesheet' href='$src' type='text/css' media='$media' />\n"; 40 echo apply_filters( 'style_loader_tag', "<link rel='stylesheet' href='$rtl_href' type='text/css' media='$media' />\n", $handle ); 41 } 42 43 echo $end_cond; 33 44 34 45 // Could do something with $this->registered[$handle]->extra here to print out extra CSS rules … … 47 58 return $r; 48 59 } 60 61 function _css_href( $src, $ver, $handle ) { 62 if ( !preg_match('|^https?://|', $src) ) { 63 $src = $this->base_url . $src; 64 } 65 66 $src = add_query_arg('ver', $ver, $src); 67 $src = apply_filters( 'style_loader_src', $src, $handle ); 68 return clean_url( $src ); 69 } 70 49 71 }
Note: See TracChangeset
for help on using the changeset viewer.