Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/04/2015 12:38:02 PM (5 years ago)
Author:
boonebgorges
Message:

In bp-legacy, load theme-specific stylesheets if found in the stack.

When enqueuing stylesheets, bp-legacy will look for files called
{stylesheet}.css, where {stylesheet} is the name of your current theme. This
will enable bp-legacy to ship with supplementary stylesheets that target
specific themes, such as WP's twenty* default themes.

Props r-a-y.
See #6248, #6124.

File:
1 edited

Legend:

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

    r9665 r9694  
    226226            if ( $min ) {
    227227                wp_style_add_data( $rtl['handle'], 'suffix', $min );
     228            }
     229        }
     230
     231        // Compatibility stylesheets for specific themes.
     232        $asset = $this->locate_asset_in_stack( get_stylesheet() . "{$min}.css", 'css' );
     233        if ( isset( $asset['location'] ) ) {
     234            // use a unique handle
     235            $asset['handle'] = 'bp-' . get_stylesheet();
     236            wp_enqueue_style( $asset['handle'], $asset['location'], array(), $this->version, 'screen' );
     237
     238            if ( $min ) {
     239                wp_style_add_data( $asset['handle'], 'suffix', $min );
    228240            }
    229241        }
Note: See TracChangeset for help on using the changeset viewer.