Skip to:
Content

bbPress.org


Ignore:
Timestamp:
04/19/2015 04:45:02 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Templates: Micro-optimizations:

  • Remove trailing ?> tag in some template parts
  • Remove preceding ?> <?php in some template parts, after phpdoc header
  • Remove whitespace where superfluous
  • Reduce number of indentations in some template parts
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/templates/default/bbpress/user-subscriptions.php

    r5688 r5689  
    88 */
    99
    10 ?>
     10do_action( 'bbp_template_before_user_subscriptions' ); ?>
    1111
    12     <?php do_action( 'bbp_template_before_user_subscriptions' ); ?>
     12<?php if ( bbp_is_subscriptions_active() ) : ?>
    1313
    14     <?php if ( bbp_is_subscriptions_active() ) : ?>
     14    <?php if ( bbp_is_user_home() || current_user_can( 'edit_users' ) ) : ?>
    1515
    16         <?php if ( bbp_is_user_home() || current_user_can( 'edit_users' ) ) : ?>
     16        <div id="bbp-user-subscriptions" class="bbp-user-subscriptions">
     17            <h2 class="entry-title"><?php esc_html_e( 'Subscribed Forums', 'bbpress' ); ?></h2>
     18            <div class="bbp-user-section">
    1719
    18             <div id="bbp-user-subscriptions" class="bbp-user-subscriptions">
    19                 <h2 class="entry-title"><?php esc_html_e( 'Subscribed Forums', 'bbpress' ); ?></h2>
    20                 <div class="bbp-user-section">
     20                <?php if ( bbp_get_user_forum_subscriptions() ) : ?>
    2121
    22                     <?php if ( bbp_get_user_forum_subscriptions() ) : ?>
     22                    <?php bbp_get_template_part( 'loop', 'forums' ); ?>
    2323
    24                         <?php bbp_get_template_part( 'loop', 'forums' ); ?>
     24                <?php else : ?>
    2525
    26                     <?php else : ?>
     26                    <p><?php bbp_is_user_home()
     27                        ? esc_html_e( 'You are not currently subscribed to any forums.',      'bbpress' )
     28                        : esc_html_e( 'This user is not currently subscribed to any forums.', 'bbpress' );
     29                    ?></p>
    2730
    28                         <p><?php bbp_is_user_home()
    29                             ? esc_html_e( 'You are not currently subscribed to any forums.',      'bbpress' )
    30                             : esc_html_e( 'This user is not currently subscribed to any forums.', 'bbpress' );
    31                         ?></p>
     31                <?php endif; ?>
    3232
    33                     <?php endif; ?>
     33            </div>
    3434
    35                 </div>
     35            <h2 class="entry-title"><?php esc_html_e( 'Subscribed Topics', 'bbpress' ); ?></h2>
     36            <div class="bbp-user-section">
    3637
    37                 <h2 class="entry-title"><?php esc_html_e( 'Subscribed Topics', 'bbpress' ); ?></h2>
    38                 <div class="bbp-user-section">
     38                <?php if ( bbp_get_user_topic_subscriptions() ) : ?>
    3939
    40                     <?php if ( bbp_get_user_topic_subscriptions() ) : ?>
     40                    <?php bbp_get_template_part( 'pagination', 'topics' ); ?>
    4141
    42                         <?php bbp_get_template_part( 'pagination', 'topics' ); ?>
     42                    <?php bbp_get_template_part( 'loop',      'topics' ); ?>
    4343
    44                         <?php bbp_get_template_part( 'loop',      'topics' ); ?>
     44                    <?php bbp_get_template_part( 'pagination', 'topics' ); ?>
    4545
    46                         <?php bbp_get_template_part( 'pagination', 'topics' ); ?>
     46                <?php else : ?>
    4747
    48                     <?php else : ?>
     48                    <p><?php bbp_is_user_home()
     49                        ? esc_html_e( 'You are not currently subscribed to any topics.',      'bbpress' )
     50                        : esc_html_e( 'This user is not currently subscribed to any topics.', 'bbpress' );
     51                    ?></p>
    4952
    50                         <p><?php bbp_is_user_home()
    51                             ? esc_html_e( 'You are not currently subscribed to any topics.',      'bbpress' )
    52                             : esc_html_e( 'This user is not currently subscribed to any topics.', 'bbpress' );
    53                         ?></p>
     53                <?php endif; ?>
    5454
    55                     <?php endif; ?>
    56 
    57                 </div>
    58             </div><!-- #bbp-user-subscriptions -->
    59 
    60         <?php endif; ?>
     55            </div>
     56        </div><!-- #bbp-user-subscriptions -->
    6157
    6258    <?php endif; ?>
    6359
    64     <?php do_action( 'bbp_template_after_user_subscriptions' ); ?>
     60<?php endif; ?>
     61
     62<?php do_action( 'bbp_template_after_user_subscriptions' );
Note: See TracChangeset for help on using the changeset viewer.