Skip to:
Content

BuddyPress.org

Ticket #6997: 6997-bp-xprofile-template.patch

File 6997-bp-xprofile-template.patch, 2.9 KB (added by Offereins, 9 years ago)

Filter updates for bp-xprofile-template.php

  • src/bp-xprofile/bp-xprofile-template.php

    diff --git a/src/bp-xprofile/bp-xprofile-template.php b/src/bp-xprofile/bp-xprofile-template.php
    index 36ed834..c68196e 100644
    a b function bp_has_profile( $args = '' ) { 
    7373         * Filters whether or not a group has a profile to display.
    7474         *
    7575         * @since 1.1.0
     76         * @since 2.6.0 Added the `$r` parameter.
    7677         *
    7778         * @param bool   $has_groups       Whether or not there are group profiles to display.
    7879         * @param string $profile_template Current profile template being used.
     80         * @param array  $r                Array of arguments passed into the BP_XProfile_Data_Template class.
    7981         */
    80         return apply_filters( 'bp_has_profile', $profile_template->has_groups(), $profile_template );
     82        return apply_filters( 'bp_has_profile', $profile_template->has_groups(), $profile_template, $r );
    8183}
    8284
    8385/**
    function bp_the_profile_field_visibility_level_label() { 
    882884                 * Filters the profile field visibility level label.
    883885                 *
    884886                 * @since 1.6.0
     887                 * @since 2.6.0 Added the `$level` parameter.
    885888                 *
    886889                 * @param string $retval Field visibility level label.
     890                 * @param string $level  Field visibility level.
    887891                 */
    888                 return apply_filters( 'bp_get_the_profile_field_visibility_level_label', $fields[ $level ]['label'] );
     892                return apply_filters( 'bp_get_the_profile_field_visibility_level_label', $fields[ $level ]['label'], $level );
    889893        }
    890894
    891895/**
    function bp_the_profile_field_visibility_level_label() { 
    897901 * @return mixed|string
    898902 */
    899903function bp_unserialize_profile_field( $value ) {
    900         if ( is_serialized($value) ) {
    901                 $field_value = maybe_unserialize($value);
     904        if ( is_serialized( $value ) ) {
     905                $field_value = maybe_unserialize( $value );
    902906                $field_value = implode( ', ', $field_value );
    903907                return $field_value;
    904908        }
    function bp_profile_field_data( $args = '' ) { 
    941945                 * Filters the profile field data.
    942946                 *
    943947                 * @since 1.2.0
     948                 * @since 2.6.0 Added the `$r` parameter.
    944949                 *
    945950                 * @param mixed $value Profile data for a specific field for the user.
     951                 * @param array $r     Array of parsed arguments.
    946952                 */
    947                 return apply_filters( 'bp_get_profile_field_data', xprofile_get_field_data( $r['field'], $r['user_id'] ) );
     953                return apply_filters( 'bp_get_profile_field_data', xprofile_get_field_data( $r['field'], $r['user_id'] ), $r );
    948954        }
    949955
    950956/**
    function bp_profile_group_name( $deprecated = true ) { 
    11011107                 * Filters the profile group name.
    11021108                 *
    11031109                 * @since 1.0.0
     1110                 * @since 2.6.0 Added the `$group_id` parameter
    11041111                 *
    1105                  * @param string $name Name of the profile group.
     1112                 * @param string $name     Name of the profile group.
     1113                 * @param int    $group_id ID of the profile group.
    11061114                 */
    1107                 return apply_filters( 'bp_get_profile_group_name', $group->name );
     1115                return apply_filters( 'bp_get_profile_group_name', $group->name, $group_id );
    11081116        }
    11091117
    11101118/**