[buddypress-trac] [BuddyPress Trac] #7218: Only load component action and screen code when we're on the component's page

buddypress-trac noreply at wordpress.org
Thu Mar 1 20:42:01 UTC 2018


#7218: Only load component action and screen code when we're on the component's
page
-------------------------+-----------------------
 Reporter:  r-a-y        |       Owner:
     Type:  enhancement  |      Status:  reopened
 Priority:  normal       |   Milestone:  3.0
Component:  Core         |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+-----------------------

Comment (by boonebgorges):

 > We can't run the late includes hook on 'bp_init' at priority 7 because
 the 'bp_setup_nav' hook runs on 'bp_init' at priority 6 and does checks
 for the nav screen functions (see bp_core_register_nav_screen_function()
 and the is_callable() checks).

 Oh yeesh. What a mess.

 > Could do add_action( 'bp_init', 'bp_late_include', 6 ) if it is listed
 just before the 'bp_setup_nav' call if that is more semantic with our
 current 'bp_init' action hooks.

 Is it deterministically true that it'll always run before `bp_setup_nav`
 as long as it's added there first? If there are situations where a race
 condition would result, it would be a horriffic nightmare to debug. Until
 someone invents an integer between 6 and 7 (I propose we call it "Smarch")
 I guess we should go with your original suggestion.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7218#comment:62>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list