Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/20/2015 10:46:00 PM (9 years ago)
Author:
r-a-y
Message:

Follow-up to r9882.

See #6124.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress-functions.php

    r9882 r9883  
    232232
    233233        // RTL
    234         if ( is_rtl() && isset( $rtl['location'], $rtl['handle'] ) ) {
    235             $rtl['handle'] = str_replace( '-css', '-css-rtl', $rtl['handle'] );  // Backwards compatibility
    236             wp_enqueue_style( $rtl['handle'], $rtl['location'], array(), $this->version, 'screen' );
     234        if ( is_rtl() ) {
     235            $rtl = $this->locate_asset_in_stack( "buddypress-rtl{$min}.css", 'css' );
     236
     237            if ( isset( $rtl['location'], $rtl['handle'] ) ) {
     238                $rtl['handle'] = str_replace( '-css', '-css-rtl', $rtl['handle'] );  // Backwards compatibility
     239                wp_enqueue_style( $rtl['handle'], $rtl['location'], array(), $this->version, 'screen' );
     240
     241                if ( $min ) {
     242                    wp_style_add_data( $rtl['handle'], 'suffix', $min );
     243                }
     244            }
     245        }
     246
     247        // Compatibility stylesheets for specific themes.
     248        $theme = $this->locate_asset_in_stack( get_template() . "{$min}.css", 'css' );
     249        if ( ! is_rtl() && isset( $theme['location'] ) ) {
     250            // use a unique handle
     251            $theme['handle'] = 'bp-' . get_template();
     252            wp_enqueue_style( $theme['handle'], $theme['location'], array(), $this->version, 'screen' );
    237253
    238254            if ( $min ) {
    239                 wp_style_add_data( $rtl['handle'], 'suffix', $min );
     255                wp_style_add_data( $theme['handle'], 'suffix', $min );
    240256            }
    241257        }
    242258
    243         // Compatibility stylesheets for specific themes.
    244         $asset = $this->locate_asset_in_stack( get_template() . "{$min}.css", 'css' );
    245         if ( isset( $asset['location'] ) ) {
    246             // use a unique handle
    247             $asset['handle'] = 'bp-' . get_template();
    248             wp_enqueue_style( $asset['handle'], $asset['location'], array(), $this->version, 'screen' );
    249 
    250             if ( $min ) {
    251                 wp_style_add_data( $asset['handle'], 'suffix', $min );
     259        // Compatibility stylesheet for specific themes, RTL-version
     260        if ( is_rtl() ) {
     261            $theme_rtl = $this->locate_asset_in_stack( get_template() . "-rtl{$min}.css", 'css' );
     262
     263            if ( isset( $theme_rtl['location'] ) ) {
     264                $theme_rtl['handle'] = $theme['handle'] . '-rtl';
     265                wp_enqueue_style( $theme_rtl['handle'], $theme_rtl['location'], array(), $this->version, 'screen' );
     266
     267                if ( $min ) {
     268                    wp_style_add_data( $theme_rtl['handle'], 'suffix', $min );
     269                }
    252270            }
    253271        }
Note: See TracChangeset for help on using the changeset viewer.