Skip to:
Content

BuddyPress.org

Changeset 9527


Ignore:
Timestamp:
02/22/2015 10:49:32 PM (8 years ago)
Author:
johnjamesjacoby
Message:

Update bp_setup_current_user() to avoid output in WordPress Customizer. Fixes #6046. See #WP24169.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-dependency.php

    r9346 r9527  
    9696 * Set up the currently logged-in user.
    9797 *
     98 * We white-list the WordPress customizer which purposely loads the user early.
     99 *
     100 * @link https://buddypress.trac.wordpress.org/ticket/6046
     101 * @link https://core.trac.wordpress.org/ticket/24169
     102 *
    98103 * @uses did_action() To make sure the user isn't loaded out of order.
    99104 * @uses do_action() Calls 'bp_setup_current_user'.
     
    103108    // If the current user is being setup before the "init" action has fired,
    104109    // strange (and difficult to debug) role/capability issues will occur.
    105     if ( ! did_action( 'after_setup_theme' ) ) {
     110    if ( ! isset( $GLOBALS['wp_customize'] ) && ! did_action( 'after_setup_theme' ) ) {
    106111        _doing_it_wrong( __FUNCTION__, __( 'The current user is being initialized without using $wp->init().', 'buddypress' ), '1.7' );
    107112    }
Note: See TracChangeset for help on using the changeset viewer.