[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
Mon Aug 8 23:17:08 UTC 2016
#7218: Only load component action and screen code when we're on the component's
page
-------------------------+-----------------------------
Reporter: r-a-y | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Core | Version:
Severity: normal | Keywords: has-patch
-------------------------+-----------------------------
We should only load a component's action and screen code when we're on the
component's page.
This can save us some memory.
Attached patch does this for the activity component. I've introduced a
new method called `late_includes()` that runs on the
`'bp_setup_canonical_stack'` hook because that is the place where we've
ensured that `$bp->current_component` and `$bp->current_action` is fully
set up.
In the patch, I've moved some code that is not specific to the activity
component's action or screen code to `bp-activity-functions.php`
temporarily until I can figure out a better place to put them. Perhaps,
create a new file called `bp-activity-hooks.php`?
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7218>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list