Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/02/2014 11:47:12 PM (5 years ago)
Author:
johnjamesjacoby
Message:

Allow group member avatars to be passed an array of arguments, bringing them up-to-speed with pretty much all other avatar fetching functions. Pass the computed a$rguments array into the associated filters. (No changes to default arguments in these functions.)

File:
1 edited

Legend:

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

    r8737 r8750  
    23092309}
    23102310
    2311 function bp_group_member_avatar() {
    2312     echo bp_get_group_member_avatar();
    2313 }
    2314     function bp_get_group_member_avatar() {
     2311/**
     2312 * Output the group member avatar while in the groups members loop.
     2313 *
     2314 * @since BuddyPress (1.0.0)
     2315 *
     2316 * @param array $args {@see bp_core_fetch_avatar()}
     2317 */
     2318function bp_group_member_avatar( $args = '' ) {
     2319    echo bp_get_group_member_avatar( $args );
     2320}
     2321    /**
     2322     * Return the group member avatar while in the groups members loop.
     2323     *
     2324     * @since BuddyPress (1.0.0)
     2325     *
     2326     * @param array $args {@see bp_core_fetch_avatar()}
     2327     */
     2328    function bp_get_group_member_avatar( $args = '' ) {
    23152329        global $members_template;
    23162330
    2317         return apply_filters( 'bp_get_group_member_avatar', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->user_id, 'type' => 'full', 'email' => $members_template->member->user_email, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ) ) ) );
    2318     }
    2319 
    2320 function bp_group_member_avatar_thumb() {
    2321     echo bp_get_group_member_avatar_thumb();
    2322 }
    2323     function bp_get_group_member_avatar_thumb() {
     2331        $r = bp_parse_args( $args, array(
     2332            'item_id' => $members_template->member->user_id,
     2333            'type'    => 'full',
     2334            'email'   => $members_template->member->user_email,
     2335            'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name )
     2336        ) );
     2337
     2338        return apply_filters( 'bp_get_group_member_avatar', bp_core_fetch_avatar( $r ), $r );
     2339    }
     2340
     2341/**
     2342 * Output the group member avatar while in the groups members loop.
     2343 *
     2344 * @since BuddyPress (1.0.0)
     2345 *
     2346 * @param array $args {@see bp_core_fetch_avatar()}
     2347 */
     2348
     2349function bp_group_member_avatar_thumb( $args = '' ) {
     2350    echo bp_get_group_member_avatar_thumb( $args );
     2351}
     2352    /**
     2353     * Return the group member avatar while in the groups members loop.
     2354     *
     2355     * @since BuddyPress (1.0.0)
     2356     *
     2357     * @param array $args {@see bp_core_fetch_avatar()}
     2358     */
     2359    function bp_get_group_member_avatar_thumb( $args = '' ) {
    23242360        global $members_template;
    23252361
    2326         return apply_filters( 'bp_get_group_member_avatar_thumb', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->user_id, 'type' => 'thumb', 'email' => $members_template->member->user_email, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ) ) ) );
    2327     }
    2328 
     2362        $r = bp_parse_args( $args, array(
     2363            'item_id' => $members_template->member->user_id,
     2364            'type'    => 'thumb',
     2365            'email'   => $members_template->member->user_email,
     2366            'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name )
     2367        ) );
     2368
     2369        return apply_filters( 'bp_get_group_member_avatar_thumb', bp_core_fetch_avatar( $r ), $r );
     2370    }
     2371
     2372/**
     2373 * Output the group member avatar while in the groups members loop.
     2374 *
     2375 * @since BuddyPress (1.0.0)
     2376 *
     2377 * @param array $args {@see bp_core_fetch_avatar()}
     2378 */
    23292379function bp_group_member_avatar_mini( $width = 30, $height = 30 ) {
    23302380    echo bp_get_group_member_avatar_mini( $width, $height );
    23312381}
     2382    /**
     2383     * Output the group member avatar while in the groups members loop.
     2384     *
     2385     * @since BuddyPress (1.0.0)
     2386     *
     2387     * @param array $args {@see bp_core_fetch_avatar()}
     2388     */
    23322389    function bp_get_group_member_avatar_mini( $width = 30, $height = 30 ) {
    23332390        global $members_template;
    23342391
    2335         return apply_filters( 'bp_get_group_member_avatar_mini', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->user_id, 'type' => 'thumb', 'width' => $width, 'height' => $height, 'email' => $members_template->member->user_email, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ) ) ) );
     2392        $r = bp_parse_args( array(), array(
     2393            'item_id' => $members_template->member->user_id,
     2394            'type'    => 'thumb',
     2395            'email'   => $members_template->member->user_email,
     2396            'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ),
     2397            'width'   => absint( $width ),
     2398            'height'  => absint( $height )
     2399        ) );
     2400
     2401        return apply_filters( 'bp_get_group_member_avatar_mini', bp_core_fetch_avatar( $r ), $r );
    23362402    }
    23372403
Note: See TracChangeset for help on using the changeset viewer.