• Polylang calls PLL_Admin->init_user() before $wp->init, causing other plugins (such as BuddyPress and bbPress) to fire warnings, as they are deeply tied into the users system.

    Fired warning:
    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.)

    Call stack:

    bp_setup_current_user()
    do_action('set_current_user')
    wp_set_current_user()
    get_currentuserinfo()
    wp_get_current_user()
    get_current_user_id()
    PLL_Admin->init_user()
    do_action('setup_theme')

    Is PLL_Admin->init_user() required to be fired so early?

    WP version: 3.9.1
    Polylang version: 1.5
    BuddyPress version: 2.0.1

    https://wordpress.org/plugins/polylang/

Viewing 1 replies (of 1 total)
  • Plugin Author Chouby

    (@chouby)

    Hi!

    I am aware of this warning sent by BuddyPress / bbPress. I have a different view than the BuddyPress authors on this, especially because BuddyPress rises this warning against the WordPress core itself 🙂
    See https://bbpress.trac.wordpress.org/ticket/2309

    So to answer your question PLL_Admin->init_user() is fired early to allow to choose your admin language based on your user preferences.

Viewing 1 replies (of 1 total)

The topic ‘PLL_Admin->init_user() called before $wp->init’ is closed to new replies.