Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/04/2018 11:17:29 PM (22 months ago)
Author:
r-a-y
Message:

Core: Introduce hook, 'bp_late_include'.

This hook is meant to be used to load conditional files on certain pages
so we are not always loading code unnecessarily.

This fires on the 'bp_setup_canonical_stack' at priority 20 when we
have ensured that the canonical stack is set up and before we register
navigation items that do checks for screen functions.

We'll be using this hook across all components to offshore code until it
is required.

See #7218.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-dependency.php

    r11364 r11884  
    3232     */
    3333    do_action( 'bp_include' );
     34}
     35
     36/**
     37 * Fire the 'bp_late_include' action for loading conditional files.
     38 *
     39 * @since 3.0.0
     40 */
     41function bp_late_include() {
     42
     43    /**
     44     * Fires the 'bp_late_include' action.
     45     *
     46     * Allow for conditional includes on certain pages.
     47     *
     48     * @since 3.0.0
     49     */
     50    do_action( 'bp_late_include' );
    3451}
    3552
Note: See TracChangeset for help on using the changeset viewer.