Re: IMPORTANT — Plugin Devs – Read this
I ran into a problem with the bp_init method of loading, and need some feedback.
‘bp_init’ is called on ‘plugins_loaded’ p10, but ‘bp_core_set_uri_globals’ runs on ‘plugins_loaded’ p3 which depends on $bp->root_components. So its not possible to add a root component using ‘bp_init’ in time for some of the setup calls.
Here is my hack to make it work right until a solution is agreed upon. You need an additional function:
function bp_foobar_setup_root_component() {
// Register 'foobar' as a root component
if ( function_exists( 'bp_core_add_root_component' ) )
bp_core_add_root_component( BP_FOOBAR_SLUG );
}
add_action( 'plugins_loaded', 'bp_foobar_setup_root_component', 2 );