Skip to:
Content

BuddyPress.org

Changeset 8769


Ignore:
Timestamp:
08/09/2014 01:05:19 PM (11 years ago)
Author:
djpaul
Message:

Core: fix bp_core_register_deprecated_styles and bp_core_register_common_styles to load RTL CSS.

See #5614

Location:
trunk/src/bp-core
Files:
2 edited

Legend:

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

    r8765 r8769  
    4747function bp_core_register_common_styles() {
    4848    $ext = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.css' : '.min.css';
     49    $rtl = is_rtl() ? '-rtl' : '';
    4950    $url = buddypress()->plugin_url . 'bp-core/css/';
    5051
    5152    $styles = apply_filters( 'bp_core_register_common_styles', array(
    5253        'bp-admin-bar' => array(
    53             'file'         => apply_filters( 'bp_core_admin_bar_css', "{$url}admin-bar{$ext}" ),
     54            'file'         => apply_filters( 'bp_core_admin_bar_css', "{$url}admin-bar{$rtl}{$ext}" ),
    5455            'dependencies' => array( 'admin-bar' )
    5556        )
  • trunk/src/bp-core/deprecated/2.1.php

    r8737 r8769  
    4444function bp_core_register_deprecated_styles() {
    4545    $ext = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.css' : '.min.css';
     46    $rtl = is_rtl() ? '-rtl' : '';
    4647    $url = buddypress()->plugin_url . 'bp-core/deprecated/css/';
    4748
    4849    $styles = apply_filters( 'bp_core_register_deprecated_styles', array(
    4950        // Messages
    50         'bp-messages-autocomplete' => 'autocomplete/jquery.autocompletefb',
     51        'bp-messages-autocomplete' => array(
     52            'file'         => "{$url}autocomplete/jquery.autocompletefb{$rtl}{$ext}",
     53            'dependencies' => array(),
     54        )
    5155    ) );
    5256
    53     foreach ( $styles as $id => $file ) {
    54         wp_register_style( $id, $url . $file . $ext, array(), bp_get_version() );
     57    foreach ( $styles as $id => $style ) {
     58        wp_register_style( $id, $style['file'], $style['dependencies'], bp_get_version() );
    5559    }
    5660}
Note: See TracChangeset for help on using the changeset viewer.