Skip to:
Content

BuddyPress.org

Changeset 10709


Ignore:
Timestamp:
04/14/2016 11:16:13 PM (4 years ago)
Author:
r-a-y
Message:

Core: Add debug trace to bp_setup_current_user() notice.

Previously, the bp_setup_current_user was called incorrectly notice
would not output any useful info for developers.

This commit adds a debug trace so developers are able to determine
whereabouts in the codebase this notice is originating from.

See #6589.

File:
1 edited

Legend:

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

    r10497 r10709  
    223223    // strange (and difficult to debug) role/capability issues will occur.
    224224    if ( ! isset( $GLOBALS['wp_customize'] ) && ! did_action( 'after_setup_theme' ) ) {
    225         _doing_it_wrong( __FUNCTION__, __( 'The current user is being initialized without using $wp->init().', 'buddypress' ), '1.7' );
     225        $e = new Exception;
     226        $trace = $e->getTraceAsString();
     227
     228        _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' );
    226229    }
    227230
Note: See TracChangeset for help on using the changeset viewer.