Changeset 9595
- Timestamp:
- 03/05/2015 04:55:12 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-template-loader.php
r9399 r9595 33 33 34 34 // Execute code for this part 35 /** 36 * Fires at the start of bp_get_template_part(). 37 * 38 * This is a variable hook that is dependent on the slug passed in. 39 * 40 * @since BuddyPress (1.7.0) 41 * 42 * @param string $slug Template part slug requested. 43 * @param string $name Template part name requested. 44 */ 35 45 do_action( 'get_template_part_' . $slug, $slug, $name ); 36 46 … … 43 53 44 54 // Allow template parts to be filtered 55 /** 56 * Filters the template parts to be loaded. 57 * 58 * @since BuddyPress (1.7.0) 59 * 60 * @param array $templates Array of templates located. 61 * @param string $slug Template part slug requested. 62 * @param string $name Template part name requested. 63 */ 45 64 $templates = apply_filters( 'bp_get_template_part', $templates, $slug, $name ); 46 65 … … 216 235 $stack = array_unique( array_filter( $stack ) ); 217 236 237 /** 238 * Filters the "template stack" list of registered directories where templates can be found. 239 * 240 * @since BuddyPress (1.7.0) 241 * 242 * @param array $stack Array of registered directories for template locations. 243 */ 218 244 return (array) apply_filters( 'bp_get_template_stack', $stack ) ; 219 245 } … … 279 305 } 280 306 307 /** 308 * Filters possible file paths to check for for a template. 309 * 310 * This is a variable filter based on the type passed into 311 * bp_get_query_template. 312 * 313 * @since BuddyPress (1.7.0) 314 * 315 * @param array $templates Array of template files already prepared. 316 */ 317 $templates = apply_filters( "bp_get_{$type}_template", $templates ); 318 281 319 // Filter possible templates, try to match one, and set any BuddyPress theme 282 320 // compat properties so they can be cross-checked later. 283 $templates = apply_filters( "bp_get_{$type}_template", $templates );284 321 $templates = bp_set_theme_compat_templates( $templates ); 285 322 $template = bp_locate_template( $templates ); 286 323 $template = bp_set_theme_compat_template( $template ); 287 324 325 /** 326 * Filters the path to a template file. 327 * 328 * This is a variable filter based on the type passed into 329 * bp_get_query_template. 330 * 331 * @since BuddyPress (1.7.0) 332 * 333 * @param string $template Path to the most appropriate found template file. 334 */ 288 335 return apply_filters( "bp_{$type}_template", $template ); 289 336 } … … 292 339 * Get the possible subdirectories to check for templates in 293 340 * 294 * @since BuddyPress (1.7 )341 * @since BuddyPress (1.7.0) 295 342 * @param array $templates Templates we are looking for 296 343 * @return array Possible subfolders to look in … … 302 349 '' 303 350 ); 351 352 /** 353 * Filters the possible subdirectories to check for templates in. 354 * 355 * @since BuddyPress (1.7.0) 356 * 357 * @param array $locations Array of subfolders to look in. 358 * @param array $templates Array of templates we are looking for. 359 */ 304 360 return apply_filters( 'bp_get_template_locations', $locations, $templates ); 305 361 } … … 326 382 } 327 383 384 /** 385 * Filters the template locations to template files being searched for. 386 * 387 * @since BuddyPress (1.7.0) 388 * 389 * @param array $value Array of all template locations registered so far. 390 * @param array $stacks Array of template locations. 391 */ 328 392 return apply_filters( 'bp_add_template_stack_locations', array_unique( $retval ), $stacks ); 329 393 } … … 353 417 } 354 418 355 // Allow BuddyPress components to parse the main query 419 /** 420 * Fires at the end of the bp_parse_query function. 421 * 422 * Allow BuddyPress components to parse the main query. 423 * 424 * @since BuddyPress (1.7.0) 425 * 426 * @param WP_Query $posts_query WP_Query instance. Passed by reference. 427 */ 356 428 do_action_ref_array( 'bp_parse_query', array( &$posts_query ) ); 357 429 } … … 374 446 function bp_template_include_theme_supports( $template = '' ) { 375 447 376 // Look for root BuddyPress template files in parent/child themes 448 /** 449 * Filters whether or not to override the template being loaded in parent/child themes. 450 * 451 * @since BuddyPress (1.7.0) 452 * 453 * @param bool $value Whether or not there is a file override. Default false. 454 * @param string $template The path to the template file that is being used. 455 */ 377 456 $new_template = apply_filters( 'bp_get_root_template', false, $template ); 378 457 … … 383 462 } 384 463 464 /** 465 * Filters the final template being loaded in parent/child themes. 466 * 467 * @since BuddyPress (1.7.0) 468 * 469 * @param string $template The path to the template file that is being used. 470 */ 385 471 return apply_filters( 'bp_template_include_theme_supports', $template ); 386 472 }
Note: See TracChangeset
for help on using the changeset viewer.