Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/30/2014 06:57:53 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Prevent outputting visibility settings table for empty profile field groups. See #5352.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/members/single/settings/profile.php

    r8210 r8214  
    5757                        <?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
    5858
    59                             <table class="profile-settings" id="xprofile-settings-<?php bp_the_profile_group_slug(); ?>">
    60                                 <thead>
    61                                     <tr>
    62                                         <th class="title field-group-name"><?php bp_the_profile_group_name(); ?></th>
    63                                         <th class="title"><?php _e( 'Visibility', 'buddypress' ); ?></th>
    64                                     </tr>
    65                                 </thead>
     59                            <?php if ( bp_profile_fields() ) : ?>
    6660
    67                                 <tbody>
     61                                <table class="profile-settings" id="xprofile-settings-<?php bp_the_profile_group_slug(); ?>">
     62                                    <thead>
     63                                        <tr>
     64                                            <th class="title field-group-name"><?php bp_the_profile_group_name(); ?></th>
     65                                            <th class="title"><?php _e( 'Visibility', 'buddypress' ); ?></th>
     66                                        </tr>
     67                                    </thead>
    6868
    69                                     <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
     69                                    <tbody>
    7070
    71                                         <tr <?php bp_field_css_class(); ?>>
    72                                             <td class="field-name"><?php bp_the_profile_field_name(); ?></td>
    73                                             <td class="field-visibility"><?php bp_profile_settings_visibility_select(); ?></td>
    74                                         </tr>
     71                                        <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
    7572
    76                                     <?php endwhile; ?>
     73                                            <tr <?php bp_field_css_class(); ?>>
     74                                                <td class="field-name"><?php bp_the_profile_field_name(); ?></td>
     75                                                <td class="field-visibility"><?php bp_profile_settings_visibility_select(); ?></td>
     76                                            </tr>
    7777
    78                                 </tbody>
    79                             </table>
     78                                        <?php endwhile; ?>
     79
     80                                    </tbody>
     81                                </table>
     82
     83                            <?php endif; ?>
    8084
    8185                        <?php endwhile; ?>
Note: See TracChangeset for help on using the changeset viewer.