Changeset 9391
- Timestamp:
- 01/21/2015 07:37:53 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-template-loader.php
r9389 r9391 37 37 // Setup possible parts 38 38 $templates = array(); 39 if ( isset( $name ) ) 39 if ( isset( $name ) ) { 40 40 $templates[] = $slug . '-' . $name . '.php'; 41 } 41 42 $templates[] = $slug . '.php'; 42 43 … … 74 75 75 76 // Continue if template is empty 76 if ( empty( $template_name ) ) 77 if ( empty( $template_name ) ) { 77 78 continue; 79 } 78 80 79 81 // Trim off any slashes from the template name … … 84 86 85 87 // Continue if $template_location is empty 86 if ( empty( $template_location ) ) 88 if ( empty( $template_location ) ) { 87 89 continue; 90 } 88 91 89 92 // Check child theme first … … 272 275 $type = preg_replace( '|[^a-z0-9-]+|', '', $type ); 273 276 274 if ( empty( $templates ) ) 277 if ( empty( $templates ) ) { 275 278 $templates = array( "{$type}.php" ); 279 } 276 280 277 281 // Filter possible templates, try to match one, and set any BuddyPress theme … … 316 320 317 321 // Loop through locations and stacks and combine 318 foreach ( (array) $stacks as $stack ) 319 foreach ( (array) $locations as $custom_location ) 322 foreach ( (array) $stacks as $stack ) { 323 foreach ( (array) $locations as $custom_location ) { 320 324 $retval[] = untrailingslashit( trailingslashit( $stack ) . $custom_location ); 325 } 326 } 321 327 322 328 return apply_filters( 'bp_add_template_stack_locations', array_unique( $retval ), $stacks ); … … 333 339 334 340 // Bail if $posts_query is not the main loop 335 if ( ! $posts_query->is_main_query() ) 341 if ( ! $posts_query->is_main_query() ) { 336 342 return; 343 } 337 344 338 345 // Bail if filters are suppressed on this query 339 if ( true == $posts_query->get( 'suppress_filters' ) ) 346 if ( true == $posts_query->get( 'suppress_filters' ) ) { 340 347 return; 348 } 341 349 342 350 // Bail if in admin 343 if ( is_admin() ) 351 if ( is_admin() ) { 344 352 return; 353 } 345 354 346 355 // Allow BuddyPress components to parse the main query … … 370 379 // A BuddyPress template file was located, so override the WordPress 371 380 // template and use it to switch off BuddyPress's theme compatibility. 372 if ( ! empty( $new_template ) ) {381 if ( ! empty( $new_template ) ) { 373 382 $template = bp_set_template_included( $new_template ); 374 383 } … … 418 427 419 428 // Do not include on BuddyPress deactivation 420 if ( bp_is_deactivation() ) 429 if ( bp_is_deactivation() ) { 421 430 return; 431 } 422 432 423 433 // If the $wp_query global is empty (the main query has not been run,
Note: See TracChangeset
for help on using the changeset viewer.