Skip to:
Content

BuddyPress.org

Changeset 9303


Ignore:
Timestamp:
01/06/2015 06:06:08 AM (6 years ago)
Author:
tw2113
Message:

Adds hooks documentation for bp-xprofile-functions.php.

See #5949.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-functions.php

    r8987 r9303  
    3333    $groups = BP_XProfile_Group::get( $args );
    3434
     35    /**
     36     * Filters a set of field groups, populated with fields and field data.
     37     *
     38     * @since BuddyPress (2.1.0)
     39     *
     40     * @param array $groups Array of field groups and field data.
     41     * @param array $args   Array of arguments used to query for groups.
     42     */
    3543    return apply_filters( 'bp_xprofile_get_groups', $groups, $args );
    3644}
     
    147155    );
    148156
    149     // If you've added a custom field type in a plugin, register it with this filter.
     157    /**
     158     * Filters the list of all xprofile field types.
     159     *
     160     * If you've added a custom field type in a plugin, register it with this filter.
     161     *
     162     * @since BuddyPress (2.0.0)
     163     *
     164     * @param array $fields Array of field type/class name pairings.
     165     */
    150166    return apply_filters( 'bp_xprofile_get_field_types', $fields );
    151167}
     
    331347        $data = array();
    332348        foreach( (array) $values as $value ) {
     349
     350            /**
     351             * Filters the field data value for a specific field for the user.
     352             *
     353             * @since BuddyPress (1.0.0)
     354             *
     355             * @param string $value    Value saved for the field.
     356             * @param int    $field_id ID of the field being displayed.
     357             * @param int    $user_id  ID of the user being displayed.
     358             */
    333359            $data[] = apply_filters( 'xprofile_get_field_data', $value, $field_id, $user_id );
    334360        }
     
    338364        }
    339365    } else {
     366        /** This filter is documented in bp-xprofile/bp-xprofile-functions.php */
    340367        $data = apply_filters( 'xprofile_get_field_data', $values, $field_id, $user_id );
    341368    }
     
    564591    }
    565592
     593    /**
     594     * Filters a random piece of profile data for the user.
     595     *
     596     * @since BuddyPress (1.0.0)
     597     *
     598     * @param array $field_data Array holding random profile data.
     599     */
    566600    return apply_filters( 'xprofile_get_random_profile_data', $field_data );
    567601}
     
    659693    $newsubdir = '/' . $directory. '/' . $user_id;
    660694
     695    /**
     696     * Filters the avatar upload directory for a user.
     697     *
     698     * @since BuddyPress (1.1.0)
     699     *
     700     * @param array $value Array containing the path, URL, and other helpful settings.
     701     */
    661702    return apply_filters( 'xprofile_avatar_upload_dir', array(
    662703        'path'    => $path,
     
    9591000 *
    9601001 * @package BuddyPress
    961  * @since BuddyPress (1.5)
     1002 * @since BuddyPress (1.5.0)
    9621003 *
    9631004 * @return string The field name
    9641005 */
    9651006function bp_xprofile_fullname_field_name() {
     1007
     1008    /**
     1009     * Filters the field name for the Full Name xprofile field.
     1010     *
     1011     * @since BuddyPress (1.5.0)
     1012     *
     1013     * @param string BP_XPROFILE_FULLNAME_FIELD_NAME Full name field constant.
     1014     */
    9661015    return apply_filters( 'bp_xprofile_fullname_field_name', BP_XPROFILE_FULLNAME_FIELD_NAME );
    9671016}
     
    9751024    global $bp;
    9761025
     1026    /**
     1027     * Filters the visibility levels out of the $bp global.
     1028     *
     1029     * @since BuddyPress (1.6.0)
     1030     *
     1031     * @param array $visibility_levels Array of visibility levels.
     1032     */
    9771033    return apply_filters( 'bp_xprofile_get_visibility_levels', $bp->profile->visibility_levels );
    9781034}
     
    9861042 * be excluded from the profile loop.
    9871043 *
    988  * @since BuddyPress (1.6)
     1044 * @since BuddyPress (1.6.0)
    9891045 * @see BP_XProfile_Group::get()
    9901046 * @uses apply_filters() Filter bp_xprofile_get_hidden_fields_for_user to modify visibility levels,
     
    10121068    $hidden_fields = bp_xprofile_get_fields_by_visibility_levels( $displayed_user_id, $hidden_levels );
    10131069
     1070    /**
     1071     * Filters the ids of fields that are hidden for this displayed/loggedin user pair.
     1072     *
     1073     * @since BuddyPress (1.6.0)
     1074     *
     1075     * @param array $hidden_fields     Array of hidden fields for the displayed/logged in user.
     1076     * @param int   $displayed_user_id ID of the displayed user.
     1077     * @param int   $current_user_id   ID of the current user.
     1078     */
    10141079    return apply_filters( 'bp_xprofile_get_hidden_fields_for_user', $hidden_fields, $displayed_user_id, $current_user_id );
    10151080}
     
    10551120    }
    10561121
     1122    /**
     1123     * Filters the visibility levels that should be hidden for this user pair.
     1124     *
     1125     * @since BuddyPress (2.0.0)
     1126     *
     1127     * @param array $hidden_fields     Array of hidden fields for the displayed/logged in user.
     1128     * @param int   $displayed_user_id ID of the displayed user.
     1129     * @param int   $current_user_id   ID of the current user.
     1130     */
    10571131    return apply_filters( 'bp_xprofile_get_hidden_field_types_for_user', $hidden_levels, $displayed_user_id, $current_user_id );
    10581132}
     
    10611135 * Fetch an array of the xprofile fields that a given user has marked with certain visibility levels
    10621136 *
    1063  * @since BuddyPress (1.6)
     1137 * @since BuddyPress (1.6.0)
    10641138 * @see bp_xprofile_get_hidden_fields_for_user()
    10651139 *
Note: See TracChangeset for help on using the changeset viewer.