Skip to:
Content

bbPress.org

Ticket #3218: 3218.patch

File 3218.patch, 1.1 KB (added by johnjamesjacoby, 6 years ago)

Optionally support an RTL variant

  • src/templates/default/bbpress-functions.php

     
    118118         */
    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                );
    131128
     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 );
     139
    132140                // Enqueue the styles
    133141                foreach ( $styles as $handle => $attributes ) {
    134142                        bbp_enqueue_style( $handle, $attributes['file'], $attributes['dependencies'], $this->version );