Changeset 5300 for trunk/bp-core/bp-core-hooks.php
- Timestamp:
- 11/08/2011 12:11:29 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-hooks.php
r5289 r5300 3 3 if ( !defined( 'ABSPATH' ) ) exit; 4 4 5 /** Loaded ********************************************************************/ 5 /** 6 * BuddyPress Filters & Actions 7 * 8 * @package BuddyPress 9 * @subpackage Hooks 10 * 11 * This file contains the actions and filters that are used through-out BuddyPress. 12 * They are consolidated here to make searching for them easier, and to help 13 * developers understand at a glance the order in which things occur. 14 * 15 */ 6 16 7 add_action( 'plugins_loaded', 'bp_loaded', 10 ); 17 // Exit if accessed directly 18 if ( !defined( 'ABSPATH' ) ) exit; 8 19 9 add_action( 'bp_loaded', 'bp_include', 2 ); 20 /** ACTIONS *******************************************************************/ 10 21 11 add_action( 'wp', 'bp_actions', 3 ); 22 /** 23 * Attach BuddyPress to WordPress 24 * 25 * BuddyPress uses its own internal actions to help aid in additional plugin 26 * development, and to limit the amount of potential future code changes when 27 * updates to WordPress occur. 28 */ 29 add_action( 'plugins_loaded', 'bp_loaded', 10 ); 30 add_action( 'init', 'bp_init', 10 ); 31 add_action( 'wp', 'bp_ready', 10 ); 32 //add_action( 'generate_rewrite_rules', 'bp_generate_rewrite_rules', 10 ); 33 //add_action( 'wp_enqueue_scripts', 'bp_enqueue_scripts', 10 ); 34 //add_filter( 'template_include', 'bp_template_include', 10 ); 12 35 13 add_action( 'wp', 'bp_screens', 4 ); 36 /** 37 * bp_loaded - Attached to 'plugins_loaded' above 38 * 39 * Attach various loader actions to the bp_loaded action. 40 * The load order helps to execute code at the correct time. 41 * v---Load order 42 */ 43 add_action( 'bp_loaded', 'bp_setup_components', 2 ); 44 add_action( 'bp_loaded', 'bp_include', 4 ); 45 add_action( 'bp_loaded', 'bp_setup_widgets', 6 ); 46 add_action( 'bp_loaded', 'bp_core_load_admin_bar', 10 ); 14 47 15 /** Init **********************************************************************/ 48 /** 49 * bp_init - Attached to 'init' above 50 * 51 * Attach various initialization actions to the bp_init action. 52 * The load order helps to execute code at the correct time. 53 * v---Load order 54 */ 55 add_action( 'bp_init', 'bp_core_set_uri_globals', 2 ); 56 add_action( 'bp_init', 'bp_setup_globals', 4 ); 57 add_action( 'bp_init', 'bp_setup_nav', 6 ); 58 add_action( 'bp_init', 'bp_setup_title', 8 ); 16 59 17 // Attach bp_init to WordPress init 18 add_action( 'init', 'bp_init' ); 60 /** 61 * bp_ready - Attached to 'wp' above 62 * 63 * Attach various initialization actions to the bp_init action. 64 * The load order helps to execute code at the correct time. 65 * v---Load order 66 */ 67 add_action( 'bp_ready', 'bp_actions', 2 ); 68 add_action( 'bp_ready', 'bp_screens', 4 ); 19 69 20 // Parse the URI and set globals 21 add_action( 'bp_init', 'bp_core_set_uri_globals', 2 ); 22 23 // Setup component globals 24 add_action( 'bp_init', 'bp_setup_globals', 4 ); 25 26 // Setup the navigation menu 27 add_action( 'bp_init', 'bp_setup_nav', 7 ); 70 /** Admin Bar *****************************************************************/ 28 71 29 72 // Setup the navigation menu 30 73 add_action( 'admin_bar_menu', 'bp_setup_admin_bar', 11 ); 31 32 // Setup the title33 add_action( 'bp_init', 'bp_setup_title', 9 );34 35 // Setup widgets36 add_action( 'bp_loaded', 'bp_setup_widgets' );37 38 // Setup admin bar39 add_action( 'bp_loaded', 'bp_core_load_admin_bar' );40 74 41 75 /** The hooks *****************************************************************/ … … 46 80 function bp_include() { 47 81 do_action( 'bp_include' ); 82 } 83 84 /** 85 * Include files on this action 86 */ 87 function bp_setup_components() { 88 do_action( 'bp_setup_components' ); 48 89 } 49 90 … … 99 140 100 141 /** 142 * Attached to wp 143 */ 144 function bp_ready() { 145 do_action( 'bp_ready' ); 146 } 147 148 /** 101 149 * Attach potential template actions 102 150 */
Note: See TracChangeset
for help on using the changeset viewer.