[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 23:11:35 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):

 > Is it deterministically true that it'll always run before bp_setup_nav
 as long as it's added there first?

 I did a quick test, and this appears to be the case, but I guess we want
 to be on the safe side.

 > Until someone invents an integer between 6 and 7 (I propose we call it
 "Smarch")

 Did another quick test and technically, you can use a decimal for the
 priority, but it has to be set as a string:

 The following example fires in numerical order:

 {{{#!php
 <?php
 add_action( 'get_header', function() {
         echo 'fires after';
 }, 10 );

 add_action( 'get_header', function() {
         echo 'fires in between';
 }, '9.5' );

 add_action( 'get_header', function() {
         echo 'fires before';
 }, 9 );
 }}}

 I'm guessing we don't want to do this though :)

 Will stick with `'bp_setup_canonical_stack'` at priority 20, unless we
 want to use something else.

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


More information about the buddypress-trac mailing list