Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/09/2014 02:55:29 PM (11 years ago)
Author:
djpaul
Message:

Core: load RTL stylesheets when we need to.

Fixes #5614

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/deprecated/2.1.php

    r8769 r8770  
    4343 */
    4444function bp_core_register_deprecated_styles() {
    45     $ext = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.css' : '.min.css';
    46     $rtl = is_rtl() ? '-rtl' : '';
     45    $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
    4746    $url = buddypress()->plugin_url . 'bp-core/deprecated/css/';
    4847
     
    5049        // Messages
    5150        'bp-messages-autocomplete' => array(
    52             'file'         => "{$url}autocomplete/jquery.autocompletefb{$rtl}{$ext}",
     51            'file'         => "{$url}autocomplete/jquery.autocompletefb{$min}.css",
    5352            'dependencies' => array(),
    5453        )
     
    5756    foreach ( $styles as $id => $style ) {
    5857        wp_register_style( $id, $style['file'], $style['dependencies'], bp_get_version() );
     58
     59        wp_style_add_data( $id, 'rtl', true );
     60        if ( $min ) {
     61            wp_style_add_data( $id, 'suffix', $min );
     62        }
    5963    }
    6064}
     
    345349 */
    346350function bp_core_load_buddybar_css() {
    347     global $wp_styles;
    348 
    349351    if ( bp_use_wp_admin_bar() || ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) || ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) )
    350352        return;
     
    359361
    360362    wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_buddybar_rtl_css', $stylesheet ), array(), bp_get_version() );
    361     $wp_styles->add_data( 'bp-admin-bar', 'rtl', true );
    362     if ( $min )
    363         $wp_styles->add_data( 'bp-admin-bar', 'suffix', $min );
     363
     364    wp_style_add_data( 'bp-admin-bar', 'rtl', true );
     365    if ( $min ) {
     366        wp_style_add_data( 'bp-admin-bar', 'suffix', $min );
     367    }
    364368}
    365369add_action( 'bp_init', 'bp_core_load_buddybar_css' );
Note: See TracChangeset for help on using the changeset viewer.