Changeset 6285 for trunk/bp-core/bp-core-actions.php
- Timestamp:
- 09/03/2012 12:33:13 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-actions.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-actions.php
r6177 r6285 36 36 add_action( 'wp', 'bp_ready', 10 ); 37 37 add_action( 'setup_theme', 'bp_setup_theme', 10 ); 38 add_action( 'after_ theme_setup', 'bp_after_theme_setup', 10 );38 add_action( 'after_setup_theme', 'bp_after_setup_theme', 10 ); 39 39 add_action( 'wp_enqueue_scripts', 'bp_enqueue_scripts', 10 ); 40 40 add_action( 'admin_bar_menu', 'bp_setup_admin_bar', 20 ); // After WP core … … 49 49 * Attach various loader actions to the bp_loaded action. 50 50 * The load order helps to execute code at the correct time. 51 * v---Load order51 * v---Load order 52 52 */ 53 add_action( 'bp_loaded', 'bp_setup_components', 2 ); 54 add_action( 'bp_loaded', 'bp_include', 4 ); 55 add_action( 'bp_loaded', 'bp_setup_widgets', 6 ); 56 add_action( 'bp_loaded', 'bp_core_load_admin_bar', 10 ); 53 add_action( 'bp_loaded', 'bp_setup_components', 2 ); 54 add_action( 'bp_loaded', 'bp_include', 4 ); 55 add_action( 'bp_loaded', 'bp_setup_widgets', 6 ); 56 add_action( 'bp_loaded', 'bp_core_load_admin_bar', 10 ); 57 add_action( 'bp_loaded', 'bp_register_theme_packages', 16 ); 57 58 58 59 /** … … 77 78 * BuddyPress is a bully and overrides the existing themes output in many 78 79 * places. This won't always be this way, we promise. 79 * v---Load order80 * v---Load order 80 81 */ 81 add_action( 'bp_template_redirect', 'bp_redirect_canonical', 2 ); 82 add_action( 'bp_template_redirect', 'bp_actions', 4 ); 83 add_action( 'bp_template_redirect', 'bp_screens', 6 ); 82 add_action( 'bp_template_redirect', 'bp_actions', 4 ); 83 add_action( 'bp_template_redirect', 'bp_screens', 6 ); 84 85 /** 86 * Add the BuddyPress functions file 87 */ 88 add_action( 'after_setup_theme', 'bp_load_theme_functions', 1 ); 84 89 85 90 // Load the admin … … 87 92 add_action( 'bp_loaded', 'bp_admin' ); 88 93 } 89 90 /**91 * Plugin Dependency92 *93 * The purpose of the following actions is to mimic the behavior of something94 * called 'plugin dependency' which enables a plugin to have plugins of their95 * own in a safe and reliable way.96 *97 * We do this in BuddyPress by mirroring existing WordPress actions in many places98 * allowing dependant plugins to hook into the BuddyPress specific ones, thus99 * guaranteeing proper code execution only whenBuddyPresss is active.100 *101 * The following functions are wrappers for their actions, allowing them to be102 * manually called and/or piggy-backed on top of other actions if needed.103 */104 105 /** Sub-actions ***************************************************************/106 107 /**108 * Include files on this action109 */110 function bp_include() {111 do_action( 'bp_include' );112 }113 114 /**115 * Include files on this action116 */117 function bp_setup_components() {118 do_action( 'bp_setup_components' );119 }120 121 /**122 * Setup global variables and objects123 */124 function bp_setup_globals() {125 do_action( 'bp_setup_globals' );126 }127 128 /**129 * Set navigation elements130 */131 function bp_setup_nav() {132 do_action( 'bp_setup_nav' );133 }134 135 /**136 * Set up BuddyPress implementation of the WP Toolbar137 */138 function bp_setup_admin_bar() {139 if ( bp_use_wp_admin_bar() )140 do_action( 'bp_setup_admin_bar' );141 }142 143 /**144 * Set the page title145 */146 function bp_setup_title() {147 do_action( 'bp_setup_title' );148 }149 150 /**151 * Register widgets152 */153 function bp_setup_widgets() {154 do_action( 'bp_register_widgets' );155 }156 157 /**158 * Initlialize code159 */160 function bp_init() {161 do_action( 'bp_init' );162 }163 164 /**165 * Attached to plugins_loaded166 */167 function bp_loaded() {168 do_action( 'bp_loaded' );169 }170 171 /**172 * Attached to wp173 */174 function bp_ready() {175 do_action( 'bp_ready' );176 }177 178 /**179 * Attach potential template actions180 */181 function bp_actions() {182 do_action( 'bp_actions' );183 }184 185 /**186 * Attach potential template screens187 */188 function bp_screens() {189 do_action( 'bp_screens' );190 }191 192 /**193 * Initialize widgets194 */195 function bp_widgets_init() {196 do_action ( 'bp_widgets_init' );197 }198 199 /** Theme *********************************************************************/200 201 /**202 * Enqueue BuddyPress specific CSS and JS203 *204 * @since BuddyPress (1.6)205 *206 * @uses do_action() Calls 'bp_enqueue_scripts'207 */208 function bp_enqueue_scripts() {209 do_action ( 'bp_enqueue_scripts' );210 }211 212 /**213 * Piggy back action for BuddyPress sepecific theme actions before the theme has214 * been setup and the theme's functions.php has loaded.215 *216 * @since BuddyPress (1.6)217 *218 * @uses do_action() Calls 'bp_setup_theme'219 */220 function bp_setup_theme() {221 do_action ( 'bp_setup_theme' );222 }223 224 /**225 * Piggy back action for BuddyPress sepecific theme actions once the theme has226 * been setup and the theme's functions.php has loaded.227 *228 * @since BuddyPress (1.6)229 *230 * @uses do_action() Calls 'bp_after_theme_setup'231 */232 function bp_after_theme_setup() {233 do_action ( 'bp_after_theme_setup' );234 }235 236 /** Theme Compatibility Filter ************************************************/237 238 /**239 * The main filter used for theme compatibility and displaying custom BuddyPress240 * theme files.241 *242 * @since BuddyPress (1.6)243 *244 * @uses apply_filters()245 *246 * @param string $template247 * @return string Template file to use248 */249 function bp_template_include( $template = '' ) {250 return apply_filters( 'bp_template_include', $template );251 }252 253 /** Theme Permissions *********************************************************/254 255 /**256 * The main action used for redirecting BuddyPress theme actions that are not257 * permitted by the current_user258 *259 * @since BuddyPress (1.6)260 *261 * @uses do_action()262 */263 function bp_template_redirect() {264 do_action( 'bp_template_redirect' );265 }266 267 ?>
Note: See TracChangeset
for help on using the changeset viewer.