Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/04/2018 11:17:29 PM (5 years 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-actions.php

    r11589 r11884  
    8787
    8888/**
     89 * Late includes.
     90 *
     91 * Run after the canonical stack is setup to allow for conditional includes
     92 * on certain pages.
     93 */
     94add_action( 'bp_setup_canonical_stack', 'bp_late_include', 20 );
     95
     96/**
    8997 * The bp_template_redirect hook - Attached to 'template_redirect' above.
    9098 *
Note: See TracChangeset for help on using the changeset viewer.