id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc 3625,Core functions should not hook to bp_init with default priority,boonebgorges,,"I had a good discussion on ticket #3622 about the bp_init hook and plugins. Conceptually, I think that the idea behind bp_init is to let plugins attach certain actions to a point in the load order when they can be sure that BP's core functionality has been fully loaded. This mostly works - bp_setup_globals, bp_setup_nav, and other initialization hooks all happen before bp_init priority 10. However, there are a few important places in BP where we use priority 10, with the result that if a plugin happens to be loaded by WordPress *before* BP is, those hooks could fail to find the corresponding action. To wit: bp_core_load_admin_bar_css() bp_core_load_buddybar_css() bp_core_admin_menu_init() (initializes the admin menu loader) bp_core_add_ajax_hook() (creates the wp_ajax_ hooks on the front-end that WP has by default on the back end) bp_core_wpsignup_redirect() (redirects users away from wp-signup.php when BP is installed) There are also some places in the friends component where we hook to bp_init, but IMO that's not as crucial, since our optional components essentially operate like plugins anyway. I propose that all of the above function be moved from bp_init priority 10 to 8 or 9. This will obviously need some thorough testing (though I'm pretty certain that making these particular functions fire a bit *earlier* is not going to hurt anything). I'll post a patch.",enhancement,closed,normal,,Core,1.5,normal,no action required,needs-refresh,