Ticket #7364: 7364.patch
File 7364.patch, 2.9 KB (added by , 8 years ago) |
---|
-
src/bp-xprofile/bp-xprofile-template.php
1367 1367 1368 1368 // Parse optional arguments. 1369 1369 $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', 1374 1378 ), 'xprofile_settings_visibility_select' ); 1375 1379 1376 1380 // Empty return value, filled in below if a valid field ID is found. … … 1387 1391 1388 1392 <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> 1389 1393 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']; ?> 1395 1395 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"> 1397 1401 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 ) : ?> 1399 1403 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> 1401 1405 1402 </select>1406 <?php endforeach; ?> 1403 1407 1408 </select> 1409 1410 <?php echo $r['after_controls']; ?> 1411 1404 1412 <?php else : ?> 1405 1413 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'] ); ?>> 1407 1415 1408 1416 <?php endif; 1409 1417