Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/19/2016 03:46:29 AM (9 years ago)
Author:
boonebgorges
Message:

Pass parsed function parameters to a number of template filters.

The template filters in question are ones that get their main context from
a template global (say, $members_template), but get auxiliary information
about how to build markup from the function params. As such, it's useful to
have these parameters available via filter.

Props Offereins.
See #6997.

File:
1 edited

Legend:

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

    r10780 r10785  
    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.
    79      */
    80     return apply_filters( 'bp_has_profile', $profile_template->has_groups(), $profile_template );
     80     * @param array  $r                Array of arguments passed into the BP_XProfile_Data_Template class.
     81     */
     82    return apply_filters( 'bp_has_profile', $profile_template->has_groups(), $profile_template, $r );
    8183}
    8284
     
    883885         *
    884886         * @since 1.6.0
     887         * @since 2.6.0 Added the `$level` parameter.
    885888         *
    886889         * @param string $retval Field visibility level label.
    887          */
    888         return apply_filters( 'bp_get_the_profile_field_visibility_level_label', $fields[ $level ]['label'] );
     890         * @param string $level  Field visibility level.
     891         */
     892        return apply_filters( 'bp_get_the_profile_field_visibility_level_label', $fields[ $level ]['label'], $level );
    889893    }
    890894
     
    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.
    946          */
    947         return apply_filters( 'bp_get_profile_field_data', xprofile_get_field_data( $r['field'], $r['user_id'] ) );
     951         * @param array $r     Array of parsed arguments.
     952         */
     953        return apply_filters( 'bp_get_profile_field_data', xprofile_get_field_data( $r['field'], $r['user_id'] ), $r );
    948954    }
    949955
Note: See TracChangeset for help on using the changeset viewer.