X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/8a06f4f9392d1ac373442f82ee40428a3cb81395..refs/tags/wordpress-3.1-scripts:/wp-includes/class.wp-styles.php diff --git a/wp-includes/class.wp-styles.php b/wp-includes/class.wp-styles.php index 8533943c..ecc0bb9e 100644 --- a/wp-includes/class.wp-styles.php +++ b/wp-includes/class.wp-styles.php @@ -1,9 +1,31 @@ registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version; + if ( null === $this->registered[$handle]->ver ) + $ver = ''; + else + $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version; + if ( isset($this->args[$handle]) ) - $ver .= '&' . $this->args[$handle]; + $ver = $ver ? $ver . '&' . $this->args[$handle] : $this->args[$handle]; + + if ( $this->do_concat ) { + if ( $this->in_default_dir($this->registered[$handle]->src) && !isset($this->registered[$handle]->extra['conditional']) && !isset($this->registered[$handle]->extra['alt']) ) { + $this->concat .= "$handle,"; + $this->concat_version .= "$handle$ver"; + return true; + } + } if ( isset($this->registered[$handle]->args) ) - $media = attribute_escape( $this->registered[$handle]->args ); + $media = esc_attr( $this->registered[$handle]->args ); else $media = 'all'; $href = $this->_css_href( $this->registered[$handle]->src, $ver, $handle ); + $rel = isset($this->registered[$handle]->extra['alt']) && $this->registered[$handle]->extra['alt'] ? 'alternate stylesheet' : 'stylesheet'; + $title = isset($this->registered[$handle]->extra['title']) ? "title='" . esc_attr( $this->registered[$handle]->extra['title'] ) . "'" : ''; - $end_cond = ''; + $end_cond = $tag = ''; if ( isset($this->registered[$handle]->extra['conditional']) && $this->registered[$handle]->extra['conditional'] ) { - echo "\n"; } - echo apply_filters( 'style_loader_tag', "\n", $handle ); + $tag .= apply_filters( 'style_loader_tag', "\n", $handle ); if ( 'rtl' === $this->text_direction && isset($this->registered[$handle]->extra['rtl']) && $this->registered[$handle]->extra['rtl'] ) { - if ( is_bool( $this->registered[$handle]->extra['rtl'] ) ) - $rtl_href = str_replace( '.css', '-rtl.css', $href ); - else + if ( is_bool( $this->registered[$handle]->extra['rtl'] ) ) { + $suffix = isset( $this->registered[$handle]->extra['suffix'] ) ? $this->registered[$handle]->extra['suffix'] : ''; + $rtl_href = str_replace( "{$suffix}.css", "-rtl{$suffix}.css", $this->_css_href( $this->registered[$handle]->src , $ver, "$handle-rtl" )); + } else { $rtl_href = $this->_css_href( $this->registered[$handle]->extra['rtl'], $ver, "$handle-rtl" ); + } - echo apply_filters( 'style_loader_tag', "\n", $handle ); + $tag .= apply_filters( 'style_loader_tag', "\n", $handle ); } - echo $end_cond; + $tag .= $end_cond; + + if ( $this->do_concat ) + $this->print_html .= $tag; + else + echo $tag; // Could do something with $this->registered[$handle]->extra here to print out extra CSS rules // echo "