Skip to:
Content

bbPress.org

Changeset 6968


Ignore:
Timestamp:
11/19/2019 06:02:24 PM (6 years ago)
Author:
johnjamesjacoby
Message:

Default Styling: Optionally support an RTL variant of bbpress.css.

This commit allows for either/or bbpress.css or bbpress-rtl.css to exist and be enqueued as styling in the template stack, fixing a regression from 2.6.0 where the RTL CSS was expected to be appended to the end of the file.

This allows for both files to be included if they both exist, or one of them if only one does, effectively covering all bases for 2.5 and 2.6 support.

Props scmsteve for persistence. Fixes #3218. For 2.7, trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/templates/default/bbpress-functions.php

    r6910 r6968  
    119119    public function enqueue_styles() {
    120120
    121         // RTL and/or minified
    122         $suffix  = is_rtl() ? '-rtl' : '';
    123 
    124         // Get and filter the bbp-default style
    125         $styles = apply_filters( 'bbp_default_styles', array(
     121        // Setup the default styling
     122        $defaults = array(
    126123            'bbp-default' => array(
    127                 'file'         => 'css/bbpress' . $suffix . '.css',
     124                'file'         => 'css/bbpress.css',
    128125                'dependencies' => array()
    129126            )
    130         ) );
     127        );
     128
     129        // Optionally support an RTL variant
     130        if ( is_rtl() ) {
     131            $defaults['bbp-default-rtl'] = array(
     132                'file'         => 'css/bbpress-rtl.css',
     133                'dependencies' => array()
     134            );
     135        }
     136
     137        // Get and filter the bbp-default style
     138        $styles = apply_filters( 'bbp_default_styles', $defaults );
    131139
    132140        // Enqueue the styles
Note: See TracChangeset for help on using the changeset viewer.