[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 18:48:46 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 r-a-y):

 >  Since bp_setup_canonical_stack is run at bp_init::5, perhaps
 bp_late_includes() could be hooked at bp_init::7 or something like that.
 This would be much easier to reason about in bp-core-actions.php, and is
 still early enough for bp_init::10 callbacks, which I think is our main
 concern.

 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).

 So we would need to load before priority 6.  The
 `'bp_setup_canonical_stack'` at priority > `10` is the earliest, with the
 latest being `'bp_setup_nav'` at priority `0` to be safe.

 Let me know which hook is preferred and I can start committing stuff on
 the weekend.

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


More information about the buddypress-trac mailing list