Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Debug Error "bp_setup_current_user was called incorrectly"

  • Avatar of lucop1
    lucop1
    Participant

    @lucop1

    Hi,

    after upgrading from 1.6.5 to 1.7 I get this error constantly on each page and widget
    also in the wp-admin area..

    `Notice: bp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 1.7.) in /var/www/vhosts/xxxxxx.it/xxxxxx.it/wp-includes/functions.php on line 2960`

    how can i fix it?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Avatar of Renato Alves
    Renato Alves
    Participant

    @espellcaste

    Same here! :(

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    It is confusing.

    Something, probably a plugin, is most likely do a $current_user check
    for example: `is_user_logged_in()`
    in a file loaded via a loader.php with something like:
    `add_action( ‘bp_loaded’, ‘some_function_that_loads_a_file’ );`

    The codex recommends using bp_loaded, but in 1.7 the notice was added.
    I’ve been using this instead:
    `add_action( ‘bp_init’, ‘some_function_that_loads_a_file’, 9 );`

    The notice only appears if you have, in wp-config.php, debug set to true.
    `define(‘WP_DEBUG’, true);`

    Other than the notice, are you seeing anything that isn’t working probably?
    You could ignore it, at your peril, and set debug to false.
    Or you could deactivate your plugins one by one to see which one(s) is generating the notice.

    It would be helpful to get a definitive explanation from one of the core devs.

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    Courtesy of boone:

    Use `var_dump(debug_backtrace());` to see how things were loaded.
    Then comb thru the dump to see which plugin is generating the notice.

    Avatar of lucop1
    lucop1
    Participant

    @lucop1

    It was a bbPress error. Now fixed with the 2.4 version!

    So the topic status is SOLVED!

    Thank you Shane!!

    Avatar of jreeve
    jreeve
    Participant

    @jreeve

    I’m getting a lot of these errors, too, with little idea where they’re coming from. Where exactly can I put debug_backtrace() so that I can find out what’s causing this?

    Avatar of danbp
    danbp
    Moderator

    @danbp

    @jreeve,

    this post is resolved since over 1 year, so thank you to open a new post.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘[Resolved] Debug Error "bp_setup_current_user was called incorrectly"’ is closed to new replies.