Skip to:
Content

BuddyPress.org

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

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

Filter updates for bp-members-template.php

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

    diff --git a/src/bp-members/bp-members-template.php b/src/bp-members/bp-members-template.php
    index f31a3d9..d39f931 100644
    a b function bp_member_avatar( $args = '' ) { 
    772772         * Filters a members avatar.
    773773         *
    774774         * @since 1.2.0
     775         * @since 2.6.0 Added the `$args` parameter.
    775776         *
    776          * @param string $value Formatted HTML <img> element, or raw avatar URL based on $html arg.
     777         * @param string       $value Formatted HTML <img> element, or raw avatar URL based on $html arg.
     778         * @param array|string $args  See {@link bp_get_member_avatar()}.
    777779         */
    778         echo apply_filters( 'bp_member_avatar', bp_get_member_avatar( $args ) );
     780        echo apply_filters( 'bp_member_avatar', bp_get_member_avatar( $args ), $args );
    779781}
    780782        /**
    781783         * Get a member's avatar.
    function bp_member_avatar( $args = '' ) { 
    820822                 * Filters a members avatar.
    821823                 *
    822824                 * @since 1.2.0
     825                 * @since 2.6.0 Added the `$r` parameter.
    823826                 *
    824827                 * @param string $value Formatted HTML <img> element, or raw avatar URL based on $html arg.
     828                 * @param array  $r     Array of parsed arguments. See {@link bp_get_member_avatar()}.
    825829                 */
    826                 return apply_filters( 'bp_get_member_avatar', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->id, 'type' => $type, 'alt' => $alt, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'email' => $members_template->member->user_email ) ) );
     830                return apply_filters( 'bp_get_member_avatar', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->id, 'type' => $type, 'alt' => $alt, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'email' => $members_template->member->user_email ) ), $r );
    827831        }
    828832
    829833/**
    function bp_member_latest_update( $args = '' ) { 
    10331037                 * Filters the excerpt of the latest update for current member in the loop.
    10341038                 *
    10351039                 * @since 1.2.5
     1040                 * @since 2.6.0 Added the `$r` parameter.
    10361041                 *
    10371042                 * @param string $value Excerpt of the latest update for current member in the loop.
     1043                 * @param array  $r     Array of parsed arguments.
    10381044                 */
    1039                 $update_content = apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], $length ) ) ) );
     1045                $update_content = apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], $length ) ) ), $r );
    10401046
    10411047                $update_content = sprintf( _x( '- &quot;%s&quot;', 'member latest update in member directory', 'buddypress' ), $update_content );
    10421048
    function bp_member_latest_update( $args = '' ) { 
    10521058                 * Filters the latest update from the current member in the loop.
    10531059                 *
    10541060                 * @since 1.2.0
     1061                 * @since 2.6.0 Added the `$r` parameter.
    10551062                 *
    10561063                 * @param string $update_content Formatted latest update for current member.
     1064                 * @param array  $r              Array of parsed arguments.
    10571065                 */
    1058                 return apply_filters( 'bp_get_member_latest_update', $update_content );
     1066                return apply_filters( 'bp_get_member_latest_update', $update_content, $r );
    10591067        }
    10601068
    10611069/**
    function bp_member_profile_data( $args = '' ) { 
    11381146                 * Filters resulting piece of member profile data.
    11391147                 *
    11401148                 * @since 1.2.0
     1149                 * @since 2.6.0 Added the `$r` parameter.
    11411150                 *
    11421151                 * @param string|bool $data Profile data if found, otherwise false.
     1152                 * @param array       $r    Array of parsed arguments.
    11431153                 */
    11441154                return apply_filters( 'bp_get_member_profile_data', $data );
    11451155        }
    function bp_loggedin_user_avatar( $args = '' ) { 
    14291439                 * @since 1.1.0
    14301440                 *
    14311441                 * @param string $value User avatar string.
     1442                 * @param array  $r     Array of parsed arguments.
     1443                 * @param array  $args  Array of initial arguments.
    14321444                 */
    14331445                return apply_filters( 'bp_get_loggedin_user_avatar', bp_core_fetch_avatar( $r ), $r, $args );
    14341446        }
    function bp_displayed_user_avatar( $args = '' ) { 
    14821494                 * @since 1.1.0
    14831495                 *
    14841496                 * @param string $value User avatar string.
     1497                 * @param array  $r     Array of parsed arguments.
     1498                 * @param array  $args  Array of initial arguments.
    14851499                 */
    14861500                return apply_filters( 'bp_get_displayed_user_avatar', bp_core_fetch_avatar( $r ), $r, $args );
    14871501        }
    function bp_last_activity( $user_id = 0 ) { 
    15591573                 * Filters the 'active [x days ago]' string for a user.
    15601574                 *
    15611575                 * @since 1.5.0
     1576                 * @since 2.6.0 Added the `$user_id` parameter.
    15621577                 *
    1563                  * @param string $value Formatted 'active [x days ago]' string.
     1578                 * @param string $value   Formatted 'active [x days ago]' string.
     1579                 * @param int    $user_id ID of the user.
    15641580                 */
    1565                 return apply_filters( 'bp_get_last_activity', $last_activity );
     1581                return apply_filters( 'bp_get_last_activity', $last_activity, $user_id );
    15661582        }
    15671583
    15681584/**