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-templates/bp-legacy/buddypress/members/single/settings/profile.php

    r8210 r8214  
    77        <?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
    88
    9             <table class="profile-settings" id="xprofile-settings-<?php bp_the_profile_group_slug(); ?>">
    10                 <thead>
    11                     <tr>
    12                         <th class="title field-group-name"><?php bp_the_profile_group_name(); ?></th>
    13                         <th class="title"><?php _e( 'Visibility', 'buddypress' ); ?></th>
    14                     </tr>
    15                 </thead>
     9            <?php if ( bp_profile_fields() ) : ?>
    1610
    17                 <tbody>
     11                <table class="profile-settings" id="xprofile-settings-<?php bp_the_profile_group_slug(); ?>">
     12                    <thead>
     13                        <tr>
     14                            <th class="title field-group-name"><?php bp_the_profile_group_name(); ?></th>
     15                            <th class="title"><?php _e( 'Visibility', 'buddypress' ); ?></th>
     16                        </tr>
     17                    </thead>
    1818
    19                     <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
     19                    <tbody>
    2020
    21                         <tr <?php bp_field_css_class(); ?>>
    22                             <td class="field-name"><?php bp_the_profile_field_name(); ?></td>
    23                             <td class="field-visibility"><?php bp_profile_settings_visibility_select(); ?></td>
    24                         </tr>
     21                        <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
    2522
    26                     <?php endwhile; ?>
     23                            <tr <?php bp_field_css_class(); ?>>
     24                                <td class="field-name"><?php bp_the_profile_field_name(); ?></td>
     25                                <td class="field-visibility"><?php bp_profile_settings_visibility_select(); ?></td>
     26                            </tr>
    2727
    28                 </tbody>
    29             </table>
     28                        <?php endwhile; ?>
     29
     30                    </tbody>
     31                </table>
     32
     33            <?php endif; ?>
    3034
    3135        <?php endwhile; ?>
Note: See TracChangeset for help on using the changeset viewer.