Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/05/2014 07:40:14 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Set a switch to retain ye olde bp-default theme if it's been activated previously. Fixes issues with theme switching, and bp-default disappearing. Props boonebgorges. Fixes #5325. (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-update.php

    r7756 r7798  
    226226            bp_update_to_1_9();
    227227        }
     228
     229        // 1.9.2
     230        if ( $raw_db_version < 7731 ) {
     231            bp_update_to_1_9_2();
     232        }
    228233    }
    229234
     
    302307
    303308/**
     309 * Perform database updates for BP 1.9.2
     310 *
     311 * In 1.9, BuddyPress stopped registering its theme directory when it detected
     312 * that bp-default (or a child theme) was not currently being used, in effect
     313 * deprecating bp-default. However, this ended up causing problems when site
     314 * admins using bp-default would switch away from the theme temporarily:
     315 * bp-default would no longer be available, with no obvious way (outside of
     316 * a manual filter) to restore it. In 1.9.2, we add an option that flags
     317 * whether bp-default or a child theme is active at the time of upgrade; if so,
     318 * the theme directory will continue to be registered even if the theme is
     319 * deactivated temporarily. Thus, new installations will not see bp-default,
     320 * but legacy installations using the theme will continue to see it.
     321 *
     322 * @since BuddyPress (1.9.2)
     323 */
     324function bp_update_to_1_9_2() {
     325    if ( 'bp-default' === get_stylesheet() || 'bp-default' === get_template() ) {
     326        update_site_option( '_bp_retain_bp_default', 1 );
     327    }
     328}
     329
     330/**
    304331 * Redirect user to BP's What's New page on first page load after activation.
    305332 *
Note: See TracChangeset for help on using the changeset viewer.