Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Plugins Loaded When?

The plugins are loaded everytime bbPress is loaded.

If you’re don’t want any code from your plugin to execute unless you’re in the admin, you could put something like this hack at the top of your “admin-only” plugins:

if ( false === strpos($_SERVER['REQUEST_URI'], '/bb-admin/') )

return;

But just loading the plugin file shouldn’t add too much overhead. You could do something a little nicer, if you weren’t worried about loading your plugin file:

function my_admin_only() {

if ( false === strpos($_SERVER['REQUEST_URI'], '/bb-admin/') )

return;

else load_my_plugin_stuff();

}

add_action( 'init', 'my_admin_only' );

Skip to toolbar