Make WordPress Core

Changeset 13351


Ignore:
Timestamp:
02/23/2010 11:46:07 PM (16 years ago)
Author:
nacin
Message:

Proper RTL + .dev.css support, first pass. See #12292

Location:
trunk/wp-includes
Files:
2 edited

Legend:

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

    r13193 r13351  
    6969                $tag .= apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-css' $title href='$href' type='text/css' media='$media' />\n", $handle );
    7070                if ( 'rtl' === $this->text_direction && isset($this->registered[$handle]->extra['rtl']) && $this->registered[$handle]->extra['rtl'] ) {
    71                         if ( is_bool( $this->registered[$handle]->extra['rtl'] ) )
    72                                 $rtl_href = str_replace( '.css', '-rtl.css', $this->_css_href( $this->registered[$handle]->src , $ver, "$handle-rtl" ));
    73                         else
     71                        if ( is_bool( $this->registered[$handle]->extra['rtl'] ) ) {
     72                                $suffix = isset( $this->registered[$handle]->extra['suffix'] ) ? $this->registered[$handle]->extra['suffix'] : '';
     73                                $rtl_href = str_replace( "{$suffix}.css", "-rtl{$suffix}.css", $this->_css_href( $this->registered[$handle]->src , $ver, "$handle-rtl" ));
     74                        } else {
    7475                                $rtl_href = $this->_css_href( $this->registered[$handle]->extra['rtl'], $ver, "$handle-rtl" );
     76                        }
    7577
    7678                        $tag .= apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-rtl-css' $title href='$rtl_href' type='text/css' media='$media' />\n", $handle );
  • trunk/wp-includes/script-loader.php

    r13310 r13351  
    434434
    435435        $rtl_styles = array( 'wp-admin', 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'plugin-install', 'farbtastic' );
     436        // Any rtl stylesheets that don't have a .dev version for ltr
     437        $no_suffix = array( 'farbtastic' );
    436438
    437439        // all colors stylesheets need to have the same query strings (cache manifest compat)
     
    469471        $styles->add( 'custom-navigation', "/wp-admin/css/custom-navigation$suffix.css", array(), '20100215' );
    470472
    471         foreach ( $rtl_styles as $rtl_style )
     473        foreach ( $rtl_styles as $rtl_style ) {
    472474                $styles->add_data( $rtl_style, 'rtl', true );
     475                if ( $suffix && ! in_array( $rtl_style, $no_suffix ) )
     476                        $styles->add_data( $rtl_style, 'suffix', $suffix );
     477        }
    473478}
    474479
Note: See TracChangeset for help on using the changeset viewer.