Info
- 2 posts
- 2 voices
- Started 3 years ago by Ben L.
- Latest reply from _ck_
- This topic is not resolved
bbPM admin menu not working at all
-
- Posted 3 years ago #
You can download a before-alpha copy at http://www.mediafire.com/?51zcmu1mhou
The problems I'm having are that
- When I activate the plugin, it doesn't know about the "bb_is_user_logged_in()" command
- And when I delete that command from the plugin, it never finds BB_IS_ADMIN to be true.
Fatal error: Call to undefined function bb_is_user_logged_in() in J:\www\htdocs\bbpress-stable\my-plugins\bbpm.php on line 20
-
- Posted 3 years ago #
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)
-
You must log in to post.