Ticket #7305: 7305.patch
File 7305.patch, 1.2 KB (added by , 8 years ago) |
---|
-
src/bp-core/bp-core-dependency.php
207 207 /** 208 208 * Set up the currently logged-in user. 209 209 * 210 * We white-list the WordPress Customizer which purposely loads the user early.211 * If the current user is being setup before the "init" action has fired,212 * strange (and difficult to debug) role/capability issues will occur.213 *214 210 * @since 1.7.0 215 211 * 216 212 * @link https://buddypress.trac.wordpress.org/ticket/6046 217 213 * @link https://core.trac.wordpress.org/ticket/24169 218 214 */ 219 215 function bp_setup_current_user() { 220 $skip_warning = (221 ( isset( $_REQUEST['wp_customize'] ) && 'on' === $_REQUEST['wp_customize'] ) ||222 ( is_admin() && 'customize.php' === basename( $_SERVER['PHP_SELF'] ) )223 );224 216 225 if ( ! $skip_warning && ! did_action( 'after_setup_theme' ) ) {226 $e = new Exception;227 $trace = $e->getTraceAsString();228 229 _doing_it_wrong( __FUNCTION__, __( 'The current user is being initialized without using $wp->init().', 'buddypress' ) . "\n===\nTrace:\n" . substr( $trace, strpos( $trace, '#6' ) ) . "\n===\n", '1.7' );230 }231 232 217 /** 233 218 * Fires to set up the current user setup process. 234 219 *