Skip to:
Content

BuddyPress.org


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

First pass at per-field visibility/privacy for XProfile:

  • Allows admins to set default levels for specific fields
  • Allows users to set visibility/privacy on a field-by-field basis
  • Modifies the profile templates to show markup for editing visibility status

See #3695

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-loader.php

    r5705 r5789  
    1515
    1616class BP_XProfile_Component extends BP_Component {
     17    /**
     18     * The acceptable privacy levels for xprofile fields.
     19     * @since 1.6
     20     * @see bp_xprofile_get_privacy_levels()
     21     */
     22    var $privacy_levels = array();
    1723
    1824    /**
     
    8389            'datebox'
    8490        ) );
     91       
     92        // Register the privacy levels. See bp_xprofile_get_privacy_levels() to filter     
     93        $this->privacy_levels = array(
     94            'public'  => array(
     95                'id'    => 'public',
     96                'label' => __( 'Anyone', 'buddypress' )
     97            ),
     98            'loggedin' => array(
     99                'id'    => 'loggedin',
     100                'label' => __( 'Logged In Users', 'buddypress' )
     101            )
     102        );
     103       
     104        if ( bp_is_active( 'friends' ) ) {
     105            $this->privacy_levels['friends'] = array(
     106                'id'    => 'friends',
     107                'label' => __( 'My Friends', 'buddypress' )
     108            );
     109        }
    85110
    86111        // Tables
Note: See TracChangeset for help on using the changeset viewer.