Skip to:
Content

bbPress.org

Changeset 5618


Ignore:
Timestamp:
02/22/2015 10:56:03 PM (5 years ago)
Author:
johnjamesjacoby
Message:

Update bbp_setup_current_user() to avoid output in WordPress Customizer. Fixes #2309. See #WP24169.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/core/sub-actions.php

    r5594 r5618  
    136136 * Setup the currently logged-in user
    137137 *
     138 * We white-list the WordPress customizer which purposely loads the user early.
     139 *
     140 * @link https://bbpress.trac.wordpress.org/ticket/2309
     141 * @link https://core.trac.wordpress.org/ticket/24169
     142 *
    138143 * @since bbPress (r2695)
    139144 * @uses did_action() To make sure the user isn't loaded out of order
     
    144149    // If the current user is being setup before the "init" action has fired,
    145150    // strange (and difficult to debug) role/capability issues will occur.
    146     if ( ! did_action( 'after_setup_theme' ) ) {
     151    if ( ! isset( $GLOBALS['wp_customize'] ) && ! did_action( 'after_setup_theme' ) ) {
    147152        _doing_it_wrong( __FUNCTION__, __( 'The current user is being initialized without using $wp->init().', 'bbpress' ), '2.3' );
    148153    }
Note: See TracChangeset for help on using the changeset viewer.