BP_Component::setup_actions()
Set up the actions.
Description
Source
File: bp-core/classes/class-bp-component.php
public function setup_actions() {
// Setup globals.
add_action( 'bp_setup_globals', array( $this, 'setup_globals' ), 10 );
// Set up canonical stack.
add_action( 'bp_setup_canonical_stack', array( $this, 'setup_canonical_stack' ), 10 );
// Include required files. Called early to ensure that BP core
// components are loaded before plugins that hook their loader functions
// to bp_include with the default priority of 10. This is for backwards
// compatibility; henceforth, plugins should register themselves by
// extending this base class.
add_action( 'bp_include', array( $this, 'includes' ), 8 );
// Load files conditionally, based on certain pages.
add_action( 'bp_late_include', array( $this, 'late_includes' ) );
// Setup navigation.
add_action( 'bp_setup_nav', array( $this, 'setup_nav' ), 10 );
// Setup WP Toolbar menus.
add_action( 'bp_setup_admin_bar', array( $this, 'setup_admin_bar' ), $this->adminbar_myaccount_order );
// Setup component title.
add_action( 'bp_setup_title', array( $this, 'setup_title' ), 10 );
// Setup cache groups.
add_action( 'bp_setup_cache_groups', array( $this, 'setup_cache_groups' ), 10 );
// Register post types.
add_action( 'bp_register_post_types', array( $this, 'register_post_types' ), 10 );
// Register taxonomies.
add_action( 'bp_register_taxonomies', array( $this, 'register_taxonomies' ), 10 );
// Add the rewrite tags.
add_action( 'bp_add_rewrite_tags', array( $this, 'add_rewrite_tags' ), 10 );
// Add the rewrite rules.
add_action( 'bp_add_rewrite_rules', array( $this, 'add_rewrite_rules' ), 10 );
// Add the permalink structure.
add_action( 'bp_add_permastructs', array( $this, 'add_permastructs' ), 10 );
// Allow components to parse the main query.
add_action( 'bp_parse_query', array( $this, 'parse_query' ), 10 );
// Generate rewrite rules.
add_action( 'bp_generate_rewrite_rules', array( $this, 'generate_rewrite_rules' ), 10 );
/**
* Fires at the end of the setup_actions method inside BP_Component.
*
* This is a dynamic hook that is based on the component string ID.
*
* @since BuddyPress 1.5.0
*/
do_action( 'bp_' . $this->id . '_setup_actions' );
}
Changelog
| Version | Description |
|---|---|
| BuddyPress 1.5.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.