Changeset 7446 for trunk/bp-core/bp-core-dependency.php
- Timestamp:
- 10/19/2013 06:41:17 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-dependency.php
r7367 r7446 2 2 3 3 /** 4 * Plugin Dependency 4 * Plugin Dependency Action Hooks. 5 5 * 6 6 * The purpose of the following hooks is to mimic the behavior of something … … 8 8 * own in a safe and reliable way. 9 9 * 10 * We do this in BuddyPress by mirroring existing WordPress hooks sin many places10 * We do this in BuddyPress by mirroring existing WordPress hooks in many places 11 11 * allowing dependant plugins to hook into the BuddyPress specific ones, thus 12 12 * guaranteeing proper code execution only when BuddyPress is active. 13 13 * 14 * The following functions are wrappers for hooks s, allowing them to be14 * The following functions are wrappers for hooks, allowing them to be 15 15 * manually called and/or piggy-backed on top of other hooks if needed. 16 16 * … … 19 19 20 20 /** 21 * Include files on this action21 * Fire the 'bp_include' action, where plugins should include files. 22 22 */ 23 23 function bp_include() { … … 26 26 27 27 /** 28 * Include files on this action28 * Fire the 'bp_setup_components' action, where plugins should initialize components. 29 29 */ 30 30 function bp_setup_components() { … … 33 33 34 34 /** 35 * Setup global variables and objects35 * Fire the 'bp_setup_globals' action, where plugins should initialize global settings. 36 36 */ 37 37 function bp_setup_globals() { … … 40 40 41 41 /** 42 * Set navigation elements42 * Fire the 'bp_setup_nav' action, where plugins should register their navigation items. 43 43 */ 44 44 function bp_setup_nav() { … … 47 47 48 48 /** 49 * Set up BuddyPress implementation of the WP Toolbar49 * Fire the 'bp_setup_admin_bar' action, where plugins should add items to the WP admin bar. 50 50 */ 51 51 function bp_setup_admin_bar() { … … 55 55 56 56 /** 57 * Set the page title57 * Fire the 'bp_setup_title' action, where plugins should modify the page title. 58 58 */ 59 59 function bp_setup_title() { … … 62 62 63 63 /** 64 * Register widgets64 * Fire the 'bp_register_widgets' action, where plugins should register widgets. 65 65 */ 66 66 function bp_setup_widgets() { … … 69 69 70 70 /** 71 * Set up the currently logged-in user72 * 73 * @uses did_action() To make sure the user isn't loaded out of order 74 * @uses do_action() Calls 'bp_setup_current_user' 71 * Set up the currently logged-in user. 72 * 73 * @uses did_action() To make sure the user isn't loaded out of order. 74 * @uses do_action() Calls 'bp_setup_current_user'. 75 75 */ 76 76 function bp_setup_current_user() { … … 86 86 87 87 /** 88 * Initlialize code88 * Fire the 'bp_init' action, BuddyPress's main initialization hook. 89 89 */ 90 90 function bp_init() { … … 93 93 94 94 /** 95 * Attached to plugins_loaded 95 * Fire the 'bp_loaded' action, which fires after BP's core plugin files have been loaded. 96 * 97 * Attached to 'plugins_loaded'. 96 98 */ 97 99 function bp_loaded() { … … 100 102 101 103 /** 102 * Attached to wp 104 * Fire the 'bp_ready' action, which runs after BP is set up and the page is about to render. 105 * 106 * Attached to 'wp'. 103 107 */ 104 108 function bp_ready() { … … 107 111 108 112 /** 109 * Attach potential template actions 113 * Fire the 'bp_actions' action, which runs just before rendering. 114 * 115 * Attach potential template actions, such as catching form requests or routing 116 * custom URLs. 110 117 */ 111 118 function bp_actions() { … … 114 121 115 122 /** 116 * Attach potential template screens 123 * Fire the 'bp_screens' action, which runs just before rendering. 124 * 125 * Runs just after 'bp_actions'. Use this hook to attach your template 126 * loaders. 117 127 */ 118 128 function bp_screens() { … … 121 131 122 132 /** 123 * Initialize widgets 133 * Fire 'bp_widgets_init', which runs after widgets have been set up. 134 * 135 * Hooked to 'widgets_init'. 124 136 */ 125 137 function bp_widgets_init() { … … 128 140 129 141 /** 130 * BuddyPress head scripts 142 * Fire 'bp_head', which is used to hook scripts and styles in the <head>. 143 * 144 * Hooked to 'wp_head'. 131 145 */ 132 146 function bp_head() { … … 137 151 138 152 /** 139 * The main action used for redirecting BuddyPress theme actions that are not 140 * permitted by the current_user 141 * 142 * @since BuddyPress (1.6) 153 * Fire the 'bp_template_redirect' action. 154 * 155 * Run at 'template_redirect', just before WordPress selects and loads a theme 156 * template. The main purpose of this hook in BuddyPress is to redirect users 157 * who do not have the proper permission to access certain content. 158 * 159 * @since BuddyPress (1.6.0) 143 160 * 144 161 * @uses do_action() … … 151 168 152 169 /** 153 * The main action used registering theme directory 154 * 155 * @since BuddyPress (1.5) 170 * Fire the 'bp_register_theme_directory' action. 171 * 172 * The main action used registering theme directories. 173 * 174 * @since BuddyPress (1.5.0) 175 * 156 176 * @uses do_action() 157 177 */ … … 161 181 162 182 /** 163 * The main action used registering theme packages 164 * 165 * @since BuddyPress (1.7) 183 * Fire the 'bp_register_theme_packages' action. 184 * 185 * The main action used registering theme packages. 186 * 187 * @since BuddyPress (1.7.0) 188 * 166 189 * @uses do_action() 167 190 */ … … 171 194 172 195 /** 173 * Enqueue BuddyPress specific CSS and JS174 * 175 * @since BuddyPress (1.6 )176 * 177 * @uses do_action() Calls 'bp_enqueue_scripts' 196 * Fire the 'bp_enqueue_scripts' action, where BP enqueues its CSS and JS. 197 * 198 * @since BuddyPress (1.6.0) 199 * 200 * @uses do_action() Calls 'bp_enqueue_scripts'. 178 201 */ 179 202 function bp_enqueue_scripts() { … … 182 205 183 206 /** 184 * Add the BuddyPress-specific rewrite tags 185 * 186 * @since BuddyPress (1.8) 187 * @uses do_action() Calls 'bp_add_rewrite_tags' 207 * Fire the 'bp_add_rewrite_tag' action, where BP adds its custom rewrite tags. 208 * 209 * @since BuddyPress (1.8.0) 210 * 211 * @uses do_action() Calls 'bp_add_rewrite_tags'. 188 212 */ 189 213 function bp_add_rewrite_tags() { … … 192 216 193 217 /** 194 * Add the BuddyPress-specific rewrite rules 195 * 196 * @since BuddyPress (1.9) 197 * @uses do_action() Calls 'bp_add_rewrite_rules' 218 * Fire the 'bp_add_rewrite_rules' action, where BP adds its custom rewrite rules. 219 * 220 * @since BuddyPress (1.9.0) 221 * 222 * @uses do_action() Calls 'bp_add_rewrite_rules'. 198 223 */ 199 224 function bp_add_rewrite_rules() { … … 202 227 203 228 /** 204 * Add the BuddyPress-specific permalink structures 205 * 206 * @since BuddyPress (1.9) 207 * @uses do_action() Calls 'bp_add_permastructs' 229 * Fire the 'bp_add_permastructs' action, where BP adds its BP-specific permalink structure. 230 * 231 * @since BuddyPress (1.9.0) 232 * 233 * @uses do_action() Calls 'bp_add_permastructs'. 208 234 */ 209 235 function bp_add_permastructs() { … … 212 238 213 239 /** 214 * Piggy back action for BuddyPress sepecific theme actions before the theme has 215 * been setup and the theme's functions.php has loaded. 216 * 217 * @since BuddyPress (1.6) 218 * 219 * @uses do_action() Calls 'bp_setup_theme' 240 * Fire the 'bp_setup_theme' action. 241 * 242 * The main purpose of 'bp_setup_theme' is give themes a place to load their 243 * BuddyPress-specific functionality. 244 * 245 * @since BuddyPress (1.6.0) 246 * 247 * @uses do_action() Calls 'bp_setup_theme'. 220 248 */ 221 249 function bp_setup_theme() { … … 224 252 225 253 /** 226 * Piggy back action for BuddyPress sepecific theme actions once the theme has 227 * been setup and the theme's functions.php has loaded. 254 * Fire the 'bp_after_setup_theme' action. 255 * 256 * Piggy-back action for BuddyPress-specific theme actions once the theme has 257 * been set up and the theme's functions.php has loaded. 228 258 * 229 259 * Hooked to 'after_setup_theme' with a priority of 100. This allows plenty of … … 231 261 * before our theme compatibility layer kicks in. 232 262 * 233 * @since BuddyPress (1.6 )234 * 235 * @uses do_action() Calls 'bp_after_setup_theme' 263 * @since BuddyPress (1.6.0) 264 * 265 * @uses do_action() Calls 'bp_after_setup_theme'. 236 266 */ 237 267 function bp_after_setup_theme() { … … 242 272 243 273 /** 244 * Piggy back filter for WordPress's 'request' filter 245 * 246 * @since BuddyPress (1.7) 247 * @param array $query_vars 248 * @return array 274 * Fire the 'bp_request' filter, a piggy-back of WP's 'request'. 275 * 276 * @since BuddyPress (1.7.0) 277 * 278 * @see WP::parse_request() for a description of parameters. 279 * 280 * @param array $query_vars See {@link WP::parse_request()}. 281 * @return array $query_vars See {@link WP::parse_request()}. 249 282 */ 250 283 function bp_request( $query_vars = array() ) { … … 253 286 254 287 /** 255 * Piggy back filter to handle login redirects.256 * 257 * @since BuddyPress (1.7 )258 * 259 * @param string $redirect_to 260 * @param string $redirect_to_raw 261 * @param string $user 288 * Fire the 'bp_login_redirect' filter, a piggy-back of WP's 'login_redirect'. 289 * 290 * @since BuddyPress (1.7.0) 291 * 292 * @param string $redirect_to See 'login_redirect'. 293 * @param string $redirect_to_raw See 'login_redirect'. 294 * @param string $user See 'login_redirect'. 262 295 */ 263 296 function bp_login_redirect( $redirect_to = '', $redirect_to_raw = '', $user = false ) { … … 266 299 267 300 /** 268 * The main filter used for theme compatibility and displaying custom BuddyPress 269 * theme files. 270 * 271 * @since BuddyPress (1.6) 301 * Fire 'bp_template_include', main filter used for theme compatibility and displaying custom BP theme files. 302 * 303 * Hooked to 'template_include'. 304 * 305 * @since BuddyPress (1.6.0) 272 306 * 273 307 * @uses apply_filters() 274 308 * 275 * @param string $template 276 * @return string Template file to use 309 * @param string $template See 'template_include'. 310 * @return string Template file to use. 277 311 */ 278 312 function bp_template_include( $template = '' ) { … … 281 315 282 316 /** 283 * Generate BuddyPress-specific rewrite rules 284 * 285 * @since BuddyPress (1.7) 286 * @param WP_Rewrite $wp_rewrite 287 * @uses do_action() Calls 'bp_generate_rewrite_rules' with {@link WP_Rewrite} 317 * Fire the 'bp_generate_rewrite_rules' filter, where BP generates its rewrite rules. 318 * 319 * @since BuddyPress (1.7.0) 320 * 321 * @uses do_action() Calls 'bp_generate_rewrite_rules' with {@link WP_Rewrite}. 322 * 323 * @param WP_Rewrite $wp_rewrite See 'generate_rewrite_rules'. 288 324 */ 289 325 function bp_generate_rewrite_rules( $wp_rewrite ) { … … 292 328 293 329 /** 294 * Filter the allowed themes list for BuddyPress specific themes 295 * 296 * @since BuddyPress (1.7) 297 * @uses apply_filters() Calls 'bp_allowed_themes' with the allowed themes list 330 * Fire the 'bp_allowed_themes' filter. 331 * 332 * Filter the allowed themes list for BuddyPress-specific themes. 333 * 334 * @since BuddyPress (1.7.0) 335 * 336 * @uses apply_filters() Calls 'bp_allowed_themes' with the allowed themes list. 298 337 */ 299 338 function bp_allowed_themes( $themes ) {
Note: See TracChangeset
for help on using the changeset viewer.