Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/21/2015 07:37:53 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Add brackets and whitespace in bp-core-template-loader.php.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-template-loader.php

    r9389 r9391  
    3737        // Setup possible parts
    3838        $templates = array();
    39         if ( isset( $name ) )
     39        if ( isset( $name ) ) {
    4040                $templates[] = $slug . '-' . $name . '.php';
     41        }
    4142        $templates[] = $slug . '.php';
    4243
     
    7475
    7576                // Continue if template is empty
    76                 if ( empty( $template_name ) )
     77                if ( empty( $template_name ) ) {
    7778                        continue;
     79                }
    7880
    7981                // Trim off any slashes from the template name
     
    8486
    8587                        // Continue if $template_location is empty
    86                         if ( empty( $template_location ) )
     88                        if ( empty( $template_location ) ) {
    8789                                continue;
     90                        }
    8891
    8992                        // Check child theme first
     
    272275        $type = preg_replace( '|[^a-z0-9-]+|', '', $type );
    273276
    274         if ( empty( $templates ) )
     277        if ( empty( $templates ) ) {
    275278                $templates = array( "{$type}.php" );
     279        }
    276280
    277281        // Filter possible templates, try to match one, and set any BuddyPress theme
     
    316320
    317321        // 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 ) {
    320324                        $retval[] = untrailingslashit( trailingslashit( $stack ) . $custom_location );
     325                }
     326        }
    321327
    322328        return apply_filters( 'bp_add_template_stack_locations', array_unique( $retval ), $stacks );
     
    333339
    334340        // Bail if $posts_query is not the main loop
    335         if ( ! $posts_query->is_main_query() )
     341        if ( ! $posts_query->is_main_query() ) {
    336342                return;
     343        }
    337344
    338345        // Bail if filters are suppressed on this query
    339         if ( true == $posts_query->get( 'suppress_filters' ) )
     346        if ( true == $posts_query->get( 'suppress_filters' ) ) {
    340347                return;
     348        }
    341349
    342350        // Bail if in admin
    343         if ( is_admin() )
     351        if ( is_admin() ) {
    344352                return;
     353        }
    345354
    346355        // Allow BuddyPress components to parse the main query
     
    370379        // A BuddyPress template file was located, so override the WordPress
    371380        // template and use it to switch off BuddyPress's theme compatibility.
    372         if ( !empty( $new_template ) ) {
     381        if ( ! empty( $new_template ) ) {
    373382                $template = bp_set_template_included( $new_template );
    374383        }
     
    418427
    419428        // Do not include on BuddyPress deactivation
    420         if ( bp_is_deactivation() )
     429        if ( bp_is_deactivation() ) {
    421430                return;
     431        }
    422432
    423433        // If the $wp_query global is empty (the main query has not been run,
Note: See TracChangeset for help on using the changeset viewer.