Changeset 5166 for trunk/templates/default/bbpress-functions.php
- Timestamp:
- 11/23/2013 10:41:28 AM (12 years ago)
- File:
-
- 1 edited
-
trunk/templates/default/bbpress-functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/templates/default/bbpress-functions.php
r5156 r5166 142 142 public function enqueue_styles() { 143 143 144 // LTR or RTL 145 $file = is_rtl() ? 'css/bbpress-rtl.css' : 'css/bbpress.css'; 146 147 // Check child theme 148 if ( file_exists( trailingslashit( get_stylesheet_directory() ) . $file ) ) { 149 $location = trailingslashit( get_stylesheet_directory_uri() ); 150 $handle = 'bbp-child-bbpress'; 151 152 // Check parent theme 153 } elseif ( file_exists( trailingslashit( get_template_directory() ) . $file ) ) { 154 $location = trailingslashit( get_template_directory_uri() ); 155 $handle = 'bbp-parent-bbpress'; 156 157 // bbPress Theme Compatibility 158 } else { 159 $location = trailingslashit( $this->url ); 160 $handle = 'bbp-default-bbpress'; 161 } 162 163 // Enqueue the bbPress styling 164 wp_enqueue_style( $handle, $location . $file, array(), $this->version, 'screen' ); 144 $styles = array( 'bbp-default' => 'css/bbpress.css' ); 145 146 if ( is_rtl() ) 147 $styles['bbp-default-rtl'] = 'css/bbpress-rtl.css'; 148 149 foreach ( $styles as $handle => $file ) { 150 151 // Check child theme 152 if ( file_exists( trailingslashit( get_stylesheet_directory() ) . $file ) ) { 153 $location = trailingslashit( get_stylesheet_directory_uri() ); 154 155 // Check parent theme 156 } elseif ( file_exists( trailingslashit( get_template_directory() ) . $file ) ) { 157 $location = trailingslashit( get_template_directory_uri() ); 158 159 // bbPress Theme Compatibility 160 } else { 161 $location = trailingslashit( $this->url ); 162 } 163 164 // Enqueue the bbPress styling 165 wp_enqueue_style( $handle, $location . $file, array(), $this->version, 'screen' ); 166 } 165 167 } 166 168
Note: See TracChangeset
for help on using the changeset viewer.