Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: bbPM admin menu not working at all


_ck_
Participant

@_ck_

I am not sure about the loading order of your plugin but keep in mind that stuff like bb_is_user_logged_in() is only available when bbPress is fully initialized.

Essentially you cannot execute anything but the most basic independent code until do_action('bb_init' happens.

So you have to hook bb_init, ie:

add_action('bb_init','your_function_name);`

and THEN your function can check bb_is_user_logged_in.

BB_IS_ADMIN is a constant so be sure to use DEFINED to test it and not directly or you’ll get an error

if (defined('BB_IS_ADMIN')) {

(also, BB_IS_ADMIN means if you are in the admin menu, not if the user is an administrator – not sure if you knew that)

Skip to toolbar