Changeset 7960 for trunk/bp-xprofile/bp-xprofile-template.php
- Timestamp:
- 02/21/2014 11:08:04 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-template.php
r7914 r7960 937 937 } 938 938 939 /** Visibility ****************************************************************/ 940 939 941 /** 940 942 * Echo the field visibility radio buttons … … 963 965 return apply_filters( 'bp_profile_get_visibility_radio_buttons', $html ); 964 966 } 967 968 /** 969 * Output the XProfile field visibility select list for settings 970 * 971 * @since BuddyPress (2.0.0) 972 */ 973 function bp_xprofile_settings_visibility_select( $args = '' ) { 974 echo bp_xprofile_get_settings_visibility_select( $args ); 975 } 976 /** 977 * Return the XProfile field visibility select list for settings 978 * 979 * @since BuddyPress (2.0.0) 980 */ 981 function bp_xprofile_get_settings_visibility_select( $args = '' ) { 982 983 // Parse optional arguments 984 $r = bp_parse_args( $args, array( 985 'before' => '', 986 'after' => '', 987 'class' => 'bp-xprofile-visibility' 988 ), 'xprofile_settings_visibility_select' ); 989 990 // Start the output buffer 991 ob_start(); 992 993 // Anything before 994 echo $r['before']; ?> 995 996 <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> 997 998 <select class="<?php echo esc_attr( $r['class'] ); ?>" name="field_<?php bp_the_profile_field_id(); ?>_visibility"> 999 1000 <?php foreach ( bp_xprofile_get_visibility_levels() as $level ) : ?> 1001 1002 <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> 1003 1004 <?php endforeach; ?> 1005 1006 </select> 1007 1008 <?php else : ?> 1009 1010 <span class="field-visibility-settings-notoggle" title="<?php _e( "This field's visibility cannot be changed.", 'buddypress' ); ?>"><?php bp_the_profile_field_visibility_level_label(); ?></span> 1011 1012 <?php endif; 1013 1014 // Anything after 1015 echo $r['after']; 1016 1017 // Output the dropdown list 1018 return apply_filters( 'bp_xprofile_settings_visibility_select', ob_get_clean() ); 1019 }
Note: See TracChangeset
for help on using the changeset viewer.