Skip to:
Content

BuddyPress.org

Changeset 9065


Ignore:
Timestamp:
10/06/2014 05:18:32 PM (12 years ago)
Author:
imath
Message:

Make sure themes can override BuddyPress stylesheet.

Since version 2.1, BuddyPress minified stylesheet is used if SCRIPT_DEBUG is not set. This was preventing themes to override the stylesheet using a file named buddypress.css. This patch make sure that if a buddypress.css file is located in one of the allowed css subfolder it will override the one provided by BuddyPress.

props r-a-y, shpitzyl

Fixes #5888 (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress-functions.php

    r9058 r9065  
    309309                if ( is_child_theme() ) {
    310310                        $locations['bp-child'] = array(
    311                                 'dir' => get_stylesheet_directory(),
    312                                 'uri' => get_stylesheet_directory_uri(),
     311                                'dir'  => get_stylesheet_directory(),
     312                                'uri'  => get_stylesheet_directory_uri(),
     313                                'file' => str_replace( '.min', '', $file )
    313314                        );
    314315                }
    315316
    316317                $locations['bp-parent'] = array(
    317                         'dir' => get_template_directory(),
    318                         'uri' => get_template_directory_uri(),
     318                        'dir'  => get_template_directory(),
     319                        'uri'  => get_template_directory_uri(),
     320                        'file' => str_replace( '.min', '', $file )
    319321                );
    320322
    321323                $locations['bp-legacy'] = array(
    322                         'dir' => bp_get_theme_compat_dir(),
    323                         'uri' => bp_get_theme_compat_url(),
     324                        'dir'  => bp_get_theme_compat_dir(),
     325                        'uri'  => bp_get_theme_compat_url(),
     326                        'file' => $file
    324327                );
    325328
    … …  
    335338                foreach ( $locations as $location_type => $location ) {
    336339                        foreach ( $subdirs as $subdir ) {
    337                                 if ( file_exists( trailingslashit( $location['dir'] ) . trailingslashit( $subdir ) . $file ) ) {
    338                                         $retval['location'] = trailingslashit( $location['uri'] ) . trailingslashit( $subdir ) . $file;
     340                                if ( file_exists( trailingslashit( $location['dir'] ) . trailingslashit( $subdir ) . $location['file'] ) ) {
     341                                        $retval['location'] = trailingslashit( $location['uri'] ) . trailingslashit( $subdir ) . $location['file'];
    339342                                        $retval['handle']   = $location_type . '-' . $type;
    340343                                        break 2;
Note: See TracChangeset for help on using the changeset viewer.