Skip to:
Content

BuddyPress.org

Ticket #7364: 7364.patch

File 7364.patch, 2.9 KB (added by hnla, 8 years ago)
  • src/bp-xprofile/bp-xprofile-template.php

     
    13671367
    13681368                // Parse optional arguments.
    13691369                $r = bp_parse_args( $args, array(
    1370                         'field_id' => bp_get_the_profile_field_id(),
    1371                         'before'   => '',
    1372                         'after'    => '',
    1373                         'class'    => 'bp-xprofile-visibility'
     1370                        'field_id'         => bp_get_the_profile_field_id(),
     1371                        'before'           => '',
     1372                        'before_controls'  => '',
     1373                        'after'            => '',
     1374                        'after_controls'   => '',
     1375                        'class'            => 'bp-xprofile-visibility',
     1376                        'label_class'      => 'bp-screen-reader-text',
     1377                        'notoggle_tag'     => 'span',
    13741378                ), 'xprofile_settings_visibility_select' );
    13751379
    13761380                // Empty return value, filled in below if a valid field ID is found.
     
    13871391
    13881392                        <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>
    13891393
    1390                                 <label for="<?php echo esc_attr( 'field_' . $r['field_id'] ) ; ?>_visibility" class="bp-screen-reader-text"><?php
    1391                                         /* translators: accessibility text */
    1392                                         _e( 'Select visibility', 'buddypress' );
    1393                                 ?></label>
    1394                                 <select class="<?php echo esc_attr( $r['class'] ); ?>" name="<?php echo esc_attr( 'field_' . $r['field_id'] ) ; ?>_visibility" id="<?php echo esc_attr( 'field_' . $r['field_id'] ) ; ?>_visibility">
     1394                                <?php echo $r['before_controls']; ?>
    13951395
    1396                                         <?php foreach ( bp_xprofile_get_visibility_levels() as $level ) : ?>
     1396                                        <label for="<?php echo esc_attr( 'field_' . $r['field_id'] ) ; ?>_visibility" class="<?php echo esc_attr( $r['label_class'] ); ?>"><?php
     1397                                                /* translators: accessibility text */
     1398                                                _e( 'Select visibility', 'buddypress' );
     1399                                        ?></label>
     1400                                        <select class="<?php echo esc_attr( $r['class'] ); ?>" name="<?php echo esc_attr( 'field_' . $r['field_id'] ) ; ?>_visibility" id="<?php echo esc_attr( 'field_' . $r['field_id'] ) ; ?>_visibility">
    13971401
    1398                                                 <option value="<?php echo esc_attr( $level['id'] ); ?>" <?php selected( $level['id'], bp_get_the_profile_field_visibility_level() ); ?>><?php echo esc_html( $level['label'] ); ?></option>
     1402                                                <?php foreach ( bp_xprofile_get_visibility_levels() as $level ) : ?>
    13991403
    1400                                         <?php endforeach; ?>
     1404                                                        <option value="<?php echo esc_attr( $level['id'] ); ?>" <?php selected( $level['id'], bp_get_the_profile_field_visibility_level() ); ?>><?php echo esc_html( $level['label'] ); ?></option>
    14011405
    1402                                 </select>
     1406                                                <?php endforeach; ?>
    14031407
     1408                                        </select>
     1409
     1410                                <?php echo $r['after_controls']; ?>
     1411
    14041412                        <?php else : ?>
    14051413
    1406                                 <span class="field-visibility-settings-notoggle"><?php bp_the_profile_field_visibility_level_label(); ?></span>
     1414                                <<?php echo esc_html( $r['notoggle_tag'] ); ?> class="field-visibility-settings-notoggle"><?php bp_the_profile_field_visibility_level_label(); ?></<?php echo esc_html( $r['notoggle_tag'] ); ?>>
    14071415
    14081416                        <?php endif;
    14091417