Skip to:
Content

BuddyPress.org

Ticket #7305: 7305.patch

File 7305.patch, 1.2 KB (added by johnjamesjacoby, 3 years ago)

Remove current_user notice code & warning for WordPress 4.7 support

  • src/bp-core/bp-core-dependency.php

     
    207207/**
    208208 * Set up the currently logged-in user.
    209209 *
    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  *
    214210 * @since 1.7.0
    215211 *
    216212 * @link https://buddypress.trac.wordpress.org/ticket/6046
    217213 * @link https://core.trac.wordpress.org/ticket/24169
    218214 */
    219215function 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         );
    224216
    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 
    232217        /**
    233218         * Fires to set up the current user setup process.
    234219         *