Skip to:
Content

BuddyPress.org

Changeset 5792


Ignore:
Timestamp:
02/15/2012 08:44:52 PM (13 years ago)
Author:
boonebgorges
Message:

Changes 'privacy' to 'visibility' throughout, when referencing xprofile fields. See #3695. Props DJPaul.

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/_inc/css/default.css

    r5789 r5792  
    23722372    margin-top: 15px;
    23732373}
    2374 body.no-js .field-privacy-settings-toggle,
    2375 body.no-js .field-privacy-settings-close {
     2374body.no-js .field-visibility-settings-toggle,
     2375body.no-js .field-visibility-settings-close {
    23762376    display: none;
    23772377}
    2378 .field-privacy-settings {
     2378.field-visibility-settings {
    23792379    display: none;
    23802380}
    2381     body.no-js .field-privacy-settings {
     2381    body.no-js .field-visibility-settings {
    23822382        display: block;
    23832383    }
    2384 .current-privacy-level {
     2384.current-visibility-level {
    23852385    font-weight: bold;
    23862386}
    2387 .field-privacy-settings-toggle a,
    2388 .field-privacy-settings a {
     2387.field-visibility-settings-toggle a,
     2388.field-visibility-settings a {
    23892389    font-size: .9em;
    23902390}
  • trunk/bp-themes/bp-default/_inc/global.js

    r5791 r5792  
    808808    });
    809809
    810     /** Profile Privacy Settings *********************************/
     810    /** Profile Visibility Settings *********************************/
    811811   
    812     jq('.privacy-toggle-link').on( 'click', function() {
     812    jq('.visibility-toggle-link').on( 'click', function() {
    813813        var toggle_div = jq(this).parent();
    814814       
    815815        jq(toggle_div).slideUp( 200, function(){
    816             jq(toggle_div).siblings('.field-privacy-settings').slideDown(200);
     816            jq(toggle_div).siblings('.field-visibility-settings').slideDown(200);
    817817        });
    818818       
     
    820820    } );
    821821
    822     jq('.field-privacy-settings-close').on( 'click', function() {
     822    jq('.field-visibility-settings-close').on( 'click', function() {
    823823        var settings_div = jq(this).parent();
    824824       
    825825        jq(settings_div).slideUp( 200, function(){
    826             jq(settings_div).siblings('.field-privacy-settings-toggle').slideDown(200);
     826            jq(settings_div).siblings('.field-visibility-settings-toggle').slideDown(200);
    827827        });
    828828       
  • trunk/bp-themes/bp-default/members/single/profile/edit.php

    r5789 r5792  
    116116                <?php /* The fullname field is always public */ ?>
    117117                <?php if ( 1 != bp_get_the_profile_field_id() ) : ?>
    118                     <div class="field-privacy-settings-toggle" id="field-privacy-settings-toggle-<?php bp_the_profile_field_id() ?>">
    119                         <?php printf( __( 'This field can be seen by: <span class="current-privacy-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_privacy_level_label() ) ?> <a href="#" class="privacy-toggle-link">Change</a>
     118                    <div class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
     119                        <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <a href="#" class="visibility-toggle-link">Change</a>
    120120                    </div>
    121121                   
    122                     <div class="field-privacy-settings" id="field-privacy-settings-<?php bp_the_profile_field_id() ?>">
    123                         <label for="field-privacy"><?php _e( 'Who can see this field?', 'buddypress' ) ?></label>
     122                    <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>">
     123                        <label for="field-visibility"><?php _e( 'Who can see this field?', 'buddypress' ) ?></label>
    124124                       
    125                         <?php bp_profile_privacy_radio_buttons() ?>
     125                        <?php bp_profile_visibility_radio_buttons() ?>
    126126                       
    127                         <a class="field-privacy-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a>
     127                        <a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a>
    128128                    </div>
    129129                <?php endif ?>
  • trunk/bp-xprofile/bp-xprofile-admin.php

    r5789 r5792  
    272272                    bp_update_option( 'bp-xprofile-fullname-field-name', $field->name );
    273273
    274                 if ( !empty( $_POST['default-privacy'] ) ) {
    275                     bp_xprofile_update_field_meta( $field_id, 'default_privacy', $_POST['default-privacy'] );
     274                if ( !empty( $_POST['default-visibility'] ) ) {
     275                    bp_xprofile_update_field_meta( $field_id, 'default_visibility', $_POST['default-visibility'] );
    276276                }
    277277
  • trunk/bp-xprofile/bp-xprofile-classes.php

    r5789 r5792  
    121121            'fetch_fields'        => false,
    122122            'fetch_field_data'    => false,
    123             'fetch_privacy_level' => false,
     123            'fetch_visibility_level' => false,
    124124            'exclude_groups'      => false,
    125125            'exclude_fields'      => false
     
    168168        }
    169169       
    170         // Privacy - Handled here so as not to be overridden by sloppy use of the
     170        // Visibility - Handled here so as not to be overridden by sloppy use of the
    171171        // exclude_fields parameter. See bp_xprofile_get_hidden_fields_for_user()
    172172        $exclude_fields_cs = array_merge( $exclude_fields_cs, bp_xprofile_get_hidden_fields_for_user( $user_id ) );
     
    241241                }
    242242                       
    243                 if ( $fetch_privacy_level ) {
    244                     $fields = self::fetch_privacy_level( $user_id, $fields );
     243                if ( $fetch_visibility_level ) {
     244                    $fields = self::fetch_visibility_level( $user_id, $fields );
    245245                }
    246246            }
     
    295295   
    296296    /**
    297      * Fetch the field privacy level for the returned fielddata
     297     * Fetch the field visibility level for the returned fielddata
    298298     */
    299     function fetch_privacy_level( $user_id, $fields ) {
     299    function fetch_visibility_level( $user_id, $fields ) {
    300300        global $wpdb, $bp;
    301301       
    302         // Get the user's privacy level preferences
    303         $privacy_levels = get_user_meta( $user_id, 'bp_xprofile_privacy_levels', true );
     302        // Get the user's visibility level preferences
     303        $visibility_levels = get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
    304304       
    305305        foreach( (array)$fields as $key => $field ) {
    306             // Look to see if the user has set the privacy for this field
    307             if ( isset( $privacy_levels[$field->id] ) ) {
    308                 $field_privacy = $privacy_levels[$field->id];
     306            // Look to see if the user has set the visibility for this field
     307            if ( isset( $visibility_levels[$field->id] ) ) {
     308                $field_visibility = $visibility_levels[$field->id];
    309309            } else {
    310310                // If not, bring up the admin-set defaults
    311                 if ( !isset( $default_privacy_levels ) ) {
    312                     $default_privacy_levels = self::fetch_default_privacy_levels();
     311                if ( !isset( $default_visibility_levels ) ) {
     312                    $default_visibility_levels = self::fetch_default_visibility_levels();
    313313                }
    314314               
    315315                // If no admin-set default is saved, fall back on a global default
    316                 $field_privacy = !empty( $default_privacy_levels[$field->id] ) ? $default_privacy_levels[$field->id] : apply_filters( 'bp_xprofile_default_privacy_level', 'public' );
     316                $field_visibility = !empty( $default_visibility_levels[$field->id] ) ? $default_visibility_levels[$field->id] : apply_filters( 'bp_xprofile_default_visibility_level', 'public' );
    317317            }
    318318           
    319             $fields[$key]->privacy_level = $field_privacy;
     319            $fields[$key]->visibility_level = $field_visibility;
    320320        }
    321321       
     
    324324   
    325325    /**
    326      * Fetch the admin-set default privacy levels for all fields
     326     * Fetch the admin-set default visibility levels for all fields
    327327     */
    328     function fetch_default_privacy_levels() {
     328    function fetch_default_visibility_levels() {
    329329        global $wpdb, $bp;
    330330       
    331         $levels = $wpdb->get_results( $wpdb->prepare( "SELECT object_id, meta_value FROM {$bp->profile->table_name_meta} WHERE object_type = 'field' AND meta_key = 'default_privacy'" ) );
     331        $levels = $wpdb->get_results( $wpdb->prepare( "SELECT object_id, meta_value FROM {$bp->profile->table_name_meta} WHERE object_type = 'field' AND meta_key = 'default_visibility'" ) );
    332332       
    333         // Arrange so that the field id is the key and the privacy level the value
    334         $default_privacy_levels = array();
     333        // Arrange so that the field id is the key and the visibility level the value
     334        $default_visibility_levels = array();
    335335        foreach( $levels as $level ) {
    336             $default_privacy_levels[$level->object_id] = $level->meta_value;
     336            $default_visibility_levels[$level->object_id] = $level->meta_value;
    337337        }
    338338       
    339         return $default_privacy_levels;
     339        return $default_visibility_levels;
    340340    }
    341341   
     
    419419    var $order_by;
    420420    var $is_default_option;
    421     var $default_privacy;
     421    var $default_visibility;
    422422
    423423    var $data;
     
    458458            }
    459459           
    460             $this->default_privacy = bp_xprofile_get_meta( $id, 'field', 'default_privacy' );
     460            $this->default_visibility = bp_xprofile_get_meta( $id, 'field', 'default_visibility' );
    461461           
    462             if ( empty( $this->default_privacy ) ) {
    463                 $this->default_privacy = 'public';
     462            if ( empty( $this->default_visibility ) ) {
     463                $this->default_visibility = 'public';
    464464            }
    465465        }
     
    723723            }
    724724           
    725             if ( empty( $this->default_privacy ) ) {
    726                 $this->default_privacy = 'public';
     725            if ( empty( $this->default_visibility ) ) {
     726                $this->default_visibility = 'public';
    727727            }
    728728
     
    878878
    879879                        <div id="titlediv">
    880                             <h3><label for="default-privacy"><?php _e( "Default Privacy Level", 'buddypress' ); ?></label></h3>
     880                            <h3><label for="default-visibility"><?php _e( "Default Visibility Level", 'buddypress' ); ?></label></h3>
    881881                            <div id="titlewrap">
    882882                                <ul>
    883                                 <?php foreach( bp_xprofile_get_privacy_levels() as $level ) : ?>
    884                                     <li><input type="radio" name="default-privacy" value="<?php echo esc_attr( $level['id'] ) ?>" <?php checked( $this->default_privacy, $level['id'] ) ?>> <?php echo esc_html( $level['label'] ) ?></li>
     883                                <?php foreach( bp_xprofile_get_visibility_levels() as $level ) : ?>
     884                                    <li><input type="radio" name="default-visibility" value="<?php echo esc_attr( $level['id'] ) ?>" <?php checked( $this->default_visibility, $level['id'] ) ?>> <?php echo esc_html( $level['label'] ) ?></li>
    885885                                <?php endforeach ?>
    886886                                </ul>
  • trunk/bp-xprofile/bp-xprofile-functions.php

    r5789 r5792  
    252252
    253253/**
    254  * Set the privacy level for this field
     254 * Set the visibility level for this field
    255255 *
    256256 * @param int $field_id The ID of the xprofile field
    257257 * @param int $user_id The ID of the user to whom the data belongs
    258  * @param string $privacy_level
     258 * @param string $visibility_level
    259259 * @return bool True on success
    260260 */
    261 function xprofile_set_field_privacy_level( $field_id = 0, $user_id = 0, $privacy_level = '' ) {
    262     if ( empty( $field_id ) || empty( $user_id ) || empty( $privacy_level ) ) {
     261function xprofile_set_field_visibility_level( $field_id = 0, $user_id = 0, $visibility_level = '' ) {
     262    if ( empty( $field_id ) || empty( $user_id ) || empty( $visibility_level ) ) {
    263263        return false;
    264264    }
     
    272272   
    273273    // Check against a whitelist
    274     $allowed_values = bp_xprofile_get_privacy_levels();
    275     if ( !array_key_exists( $privacy_level, $allowed_values ) ) {
     274    $allowed_values = bp_xprofile_get_visibility_levels();
     275    if ( !array_key_exists( $visibility_level, $allowed_values ) ) {
    276276        return false;
    277277    }
    278278   
    279279    // Stored in an array in usermeta
    280     $current_privacy_levels = get_user_meta( $user_id, 'bp_xprofile_privacy_levels', true );
    281    
    282     if ( !$current_privacy_levels ) {
    283         $current_privacy_levels = array();
    284     }
    285    
    286     $current_privacy_levels[$field_id] = $privacy_level;
    287    
    288     return update_user_meta( $user_id, 'bp_xprofile_privacy_levels', $current_privacy_levels );
     280    $current_visibility_levels = get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
     281   
     282    if ( !$current_visibility_levels ) {
     283        $current_visibility_levels = array();
     284    }
     285   
     286    $current_visibility_levels[$field_id] = $visibility_level;
     287   
     288    return update_user_meta( $user_id, 'bp_xprofile_visibility_levels', $current_visibility_levels );
    289289}
    290290
     
    645645
    646646/**
    647  * Get privacy levels out of the $bp global
     647 * Get visibility levels out of the $bp global
    648648 *
    649649 * @return array
    650650 */
    651 function bp_xprofile_get_privacy_levels() {
     651function bp_xprofile_get_visibility_levels() {
    652652    global $bp;
    653653   
    654     return apply_filters( 'bp_xprofile_get_privacy_levels', $bp->profile->privacy_levels );
     654    return apply_filters( 'bp_xprofile_get_visibility_levels', $bp->profile->visibility_levels );
    655655}
    656656
     
    658658 * Get the ids of fields that are hidden for this displayed/loggedin user pair
    659659 *
    660  * This is the function primarily responsible for profile field privacy. It works by determining
     660 * This is the function primarily responsible for profile field visibility. It works by determining
    661661 * the relationship between the displayed_user (ie the profile owner) and the current_user (ie the
    662662 * profile viewer). Then, based on that relationship, we query for the set of fields that should
     
    665665 * @since 1.6
    666666 * @see BP_XProfile_Group::get()
    667  * @uses apply_filters() Filter bp_xprofile_get_hidden_fields_for_user to modify privacy levels,
     667 * @uses apply_filters() Filter bp_xprofile_get_hidden_fields_for_user to modify visibility levels,
    668668 *   or if you have added your own custom levels
    669669 *
     
    700700            // current user is logged-in but not friends, so exclude friends-only   
    701701            $hidden_levels = array( 'friends' );           
    702             $hidden_fields = bp_xprofile_get_fields_by_privacy_levels( $displayed_user_id, $hidden_levels );
     702            $hidden_fields = bp_xprofile_get_fields_by_visibility_levels( $displayed_user_id, $hidden_levels );
    703703        }
    704704       
     
    706706        // Current user is not logged in, so exclude friends-only and loggedin
    707707        $hidden_levels = array( 'friends', 'loggedin' );
    708         $hidden_fields = bp_xprofile_get_fields_by_privacy_levels( $displayed_user_id, $hidden_levels );
     708        $hidden_fields = bp_xprofile_get_fields_by_visibility_levels( $displayed_user_id, $hidden_levels );
    709709    }
    710710   
     
    713713
    714714/**
    715  * Fetch an array of the xprofile fields that a given user has marked with certain privacy levels
     715 * Fetch an array of the xprofile fields that a given user has marked with certain visibility levels
    716716 *
    717717 * @since 1.6
     
    719719 *
    720720 * @param int $user_id The id of the profile owner
    721  * @param array $levels An array of privacy levels ('public', 'friends', 'loggedin', etc) to be
     721 * @param array $levels An array of visibility levels ('public', 'friends', 'loggedin', etc) to be
    722722 *    checked against
    723  * @return array $field_ids The fields that match the requested privacy levels for the given user
    724  */
    725 function bp_xprofile_get_fields_by_privacy_levels( $user_id, $levels = array() ) {
     723 * @return array $field_ids The fields that match the requested visibility levels for the given user
     724 */
     725function bp_xprofile_get_fields_by_visibility_levels( $user_id, $levels = array() ) {
    726726    if ( !is_array( $levels ) ) {
    727727        $levels = (array)$levels;
    728728    }
    729729   
    730     $user_privacy_levels = get_user_meta( $user_id, 'bp_xprofile_privacy_levels', true );
     730    $user_visibility_levels = get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
    731731   
    732732    $field_ids = array();
    733     foreach( (array)$user_privacy_levels as $field_id => $field_privacy ) {
    734         if ( in_array( $field_privacy, $levels ) ) {
     733    foreach( (array)$user_visibility_levels as $field_id => $field_visibility ) {
     734        if ( in_array( $field_visibility, $levels ) ) {
    735735            $field_ids[] = $field_id;
    736736        }
  • trunk/bp-xprofile/bp-xprofile-loader.php

    r5789 r5792  
    1616class BP_XProfile_Component extends BP_Component {
    1717    /**
    18      * The acceptable privacy levels for xprofile fields.
     18     * The acceptable visibility levels for xprofile fields.
    1919     * @since 1.6
    20      * @see bp_xprofile_get_privacy_levels()
    21      */
    22     var $privacy_levels = array();
     20     * @see bp_xprofile_get_visibility_levels()
     21     */
     22    var $visibility_levels = array();
    2323
    2424    /**
     
    9090        ) );
    9191       
    92         // Register the privacy levels. See bp_xprofile_get_privacy_levels() to filter     
    93         $this->privacy_levels = array(
     92        // Register the visibility levels. See bp_xprofile_get_visibility_levels() to filter       
     93        $this->visibility_levels = array(
    9494            'public'  => array(
    9595                'id'    => 'public',
     
    103103       
    104104        if ( bp_is_active( 'friends' ) ) {
    105             $this->privacy_levels['friends'] = array(
     105            $this->visibility_levels['friends'] = array(
    106106                'id'    => 'friends',
    107107                'label' => __( 'My Friends', 'buddypress' )
  • trunk/bp-xprofile/bp-xprofile-screens.php

    r5789 r5792  
    115115                    do_action( 'xprofile_profile_field_data_updated', $field_id, $value );
    116116               
    117                 // Save the privacy level
    118                 $privacy_level = !empty( $_POST['field_' . $field_id . '_privacy'] ) ? $_POST['field_' . $field_id . '_privacy'] : 'public';
    119                 xprofile_set_field_privacy_level( $field_id, bp_displayed_user_id(), $privacy_level );
     117                // Save the visibility level
     118                $visibility_level = !empty( $_POST['field_' . $field_id . '_visibility'] ) ? $_POST['field_' . $field_id . '_visibility'] : 'public';
     119                xprofile_set_field_visibility_level( $field_id, bp_displayed_user_id(), $visibility_level );
    120120            }
    121121
  • trunk/bp-xprofile/bp-xprofile-template.php

    r5789 r5792  
    2525    var $user_id;
    2626
    27     function __construct( $user_id, $profile_group_id, $hide_empty_groups = false, $fetch_fields = false, $fetch_field_data = false, $exclude_groups = false, $exclude_fields = false, $hide_empty_fields = false, $fetch_privacy_level = false ) {
     27    function __construct( $user_id, $profile_group_id, $hide_empty_groups = false, $fetch_fields = false, $fetch_field_data = false, $exclude_groups = false, $exclude_fields = false, $hide_empty_fields = false, $fetch_visibility_level = false ) {
    2828        $this->groups = BP_XProfile_Group::get( array(
    2929            'profile_group_id'    => $profile_group_id,
     
    3333            'fetch_fields'        => $fetch_fields,
    3434            'fetch_field_data'    => $fetch_field_data,
    35             'fetch_privacy_level' => $fetch_privacy_level,
     35            'fetch_visibility_level' => $fetch_visibility_level,
    3636            'exclude_groups'      => $exclude_groups,
    3737            'exclude_fields'      => $exclude_fields
     
    159159    $hide_empty_fields_default = ( !is_network_admin() && !is_admin() && !bp_is_user_profile_edit() && !bp_is_register_page() );
    160160   
    161     // We only need to fetch privacy levels when viewing your own profile
     161    // We only need to fetch visibility levels when viewing your own profile
    162162    if ( bp_is_my_profile() || bp_current_user_can( 'bp_moderate' ) ) {
    163         $fetch_privacy_level_default = true;
     163        $fetch_visibility_level_default = true;
    164164    } else {
    165         $fetch_privacy_level_default = false;
     165        $fetch_visibility_level_default = false;
    166166    }
    167167   
     
    173173        'fetch_fields'        => true,
    174174        'fetch_field_data'    => true,
    175         'fetch_privacy_level' => $fetch_privacy_level_default,
     175        'fetch_visibility_level' => $fetch_visibility_level_default,
    176176        'exclude_groups'      => false, // Comma-separated list of profile field group IDs to exclude
    177177        'exclude_fields'      => false  // Comma-separated list of profile field IDs to exclude
     
    181181    extract( $r, EXTR_SKIP );
    182182
    183     $profile_template = new BP_XProfile_Data_Template( $user_id, $profile_group_id, $hide_empty_groups, $fetch_fields, $fetch_field_data, $exclude_groups, $exclude_fields, $hide_empty_fields, $fetch_privacy_level );
     183    $profile_template = new BP_XProfile_Data_Template( $user_id, $profile_group_id, $hide_empty_groups, $fetch_fields, $fetch_field_data, $exclude_groups, $exclude_fields, $hide_empty_fields, $fetch_visibility_level );
    184184    return apply_filters( 'bp_has_profile', $profile_template->has_groups(), $profile_template );
    185185}
     
    708708
    709709/**
    710  * Echo the privacy level of this field
     710 * Echo the visibility level of this field
    711711 */
    712 function bp_the_profile_field_privacy_level() {
    713     echo bp_get_the_profile_field_privacy_level();
     712function bp_the_profile_field_visibility_level() {
     713    echo bp_get_the_profile_field_visibility_level();
    714714}
    715715    /**
    716      * Return the privacy level of this field
     716     * Return the visibility level of this field
    717717     */
    718     function bp_get_the_profile_field_privacy_level() {
     718    function bp_get_the_profile_field_visibility_level() {
    719719        global $field;
    720720       
    721         $retval = !empty( $field->privacy_level ) ? $field->privacy_level : 'public';
     721        $retval = !empty( $field->visibility_level ) ? $field->visibility_level : 'public';
    722722       
    723         return apply_filters( 'bp_get_the_profile_field_privacy_level', $retval );
     723        return apply_filters( 'bp_get_the_profile_field_visibility_level', $retval );
    724724    }
    725725
    726726/**
    727  * Echo the privacy level label of this field
     727 * Echo the visibility level label of this field
    728728 */
    729 function bp_the_profile_field_privacy_level_label() {
    730     echo bp_get_the_profile_field_privacy_level_label();
     729function bp_the_profile_field_visibility_level_label() {
     730    echo bp_get_the_profile_field_visibility_level_label();
    731731}
    732732    /**
    733      * Return the privacy level label of this field
     733     * Return the visibility level label of this field
    734734     */
    735     function bp_get_the_profile_field_privacy_level_label() {
     735    function bp_get_the_profile_field_visibility_level_label() {
    736736        global $field;
    737737       
    738         $level  = !empty( $field->privacy_level ) ? $field->privacy_level : 'public';
    739         $fields = bp_xprofile_get_privacy_levels();
     738        $level  = !empty( $field->visibility_level ) ? $field->visibility_level : 'public';
     739        $fields = bp_xprofile_get_visibility_levels();
    740740       
    741         return apply_filters( 'bp_get_the_profile_field_privacy_level_label', $fields[$level]['label'] );
     741        return apply_filters( 'bp_get_the_profile_field_visibility_level_label', $fields[$level]['label'] );
    742742    }
    743743
     
    886886
    887887/**
    888  * Echo the field privacy radio buttons
     888 * Echo the field visibility radio buttons
    889889 */
    890 function bp_profile_privacy_radio_buttons() {
    891     echo bp_profile_get_privacy_radio_buttons();
     890function bp_profile_visibility_radio_buttons() {
     891    echo bp_profile_get_visibility_radio_buttons();
    892892}
    893893    /**
    894      * Return the field privacy radio buttons
     894     * Return the field visibility radio buttons
    895895     */
    896     function bp_profile_get_privacy_radio_buttons() {       
     896    function bp_profile_get_visibility_radio_buttons() {       
    897897        $html = '<ul class="radio">';
    898898       
    899         foreach( bp_xprofile_get_privacy_levels() as $level ) {
    900             $checked = $level['id'] == bp_get_the_profile_field_privacy_level() ? ' checked="checked" ' : '';
     899        foreach( bp_xprofile_get_visibility_levels() as $level ) {
     900            $checked = $level['id'] == bp_get_the_profile_field_visibility_level() ? ' checked="checked" ' : '';
    901901           
    902             $html .= '<li><input type="radio" name="field_' . bp_get_the_profile_field_id() . '_privacy" value="' . esc_attr( $level['id'] ) . '"' . $checked . '> ' . esc_html( $level['label'] ) . '</li>';
     902            $html .= '<li><input type="radio" name="field_' . bp_get_the_profile_field_id() . '_visibility" value="' . esc_attr( $level['id'] ) . '"' . $checked . '> ' . esc_html( $level['label'] ) . '</li>';
    903903        }
    904904       
    905905        $html .= '</ul>';
    906906       
    907         return apply_filters( 'bp_profile_get_privacy_radio_buttons', $html );
     907        return apply_filters( 'bp_profile_get_visibility_radio_buttons', $html );
    908908    }
    909909?>
Note: See TracChangeset for help on using the changeset viewer.