Skip to:
Content

BuddyPress.org

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

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

Filter updates for bp-activity-template.php

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

    diff --git a/src/bp-activity/bp-activity-template.php b/src/bp-activity/bp-activity-template.php
    index b4240b2..06e8e30 100644
    a b function bp_activity_avatar( $args = '' ) { 
    11641164                 *
    11651165                 * @since 1.1.3
    11661166                 *
    1167                  * @param array $value Array of arguments calculated for use with bp_core_fetch_avatar.
     1167                 * @param array $value HTML image element holding the activity avatar.
    11681168                 */
    11691169                return apply_filters( 'bp_get_activity_avatar', bp_core_fetch_avatar( array(
    11701170                        'item_id' => $item_id,
    function bp_activity_action( $args = array() ) { 
    14271427                 *
    14281428                 * @since 1.2.0
    14291429                 *
    1430                  * @param array $value Array containing the current action, the current activity, and the $args array passed into the function.
     1430                 * @param array $value Array containing the current action, the current activity, and the $args array passed into the function.
    14311431                 */
    14321432                return apply_filters_ref_array( 'bp_get_activity_action', array(
    14331433                        $action,
    function bp_activity_comment_name() { 
    20972097                global $activities_template;
    20982098
    20992099                if ( isset( $activities_template->activity->current_comment->user_fullname ) ) {
    2100 
    21012100                        $name = apply_filters( 'bp_acomment_name', $activities_template->activity->current_comment->user_fullname, $activities_template->activity->current_comment );  // Backward compatibility.
    21022101                } else {
    21032102                        $name = $activities_template->activity->current_comment->display_name;
    function bp_activity_latest_update( $user_id = 0 ) { 
    28792878                 * Filters the latest update excerpt.
    28802879                 *
    28812880                 * @since 1.2.10
     2881                 * @since 2.6.0  Added the `$user_id` parameter.
    28822882                 *
    2883                  * @param string $value The excerpt for the latest update.
     2883                 * @param string $value   The excerpt for the latest update.
     2884                 * @param int    $user_id ID of the queried user.
    28842885                 */
    2885                 $latest_update = apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], 358 ) ) ) );
     2886                $latest_update = apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], 358 ) ) ), $user_id );
    28862887
    28872888                $latest_update = sprintf(
    28882889                        '%s <a href="%s">%s</a>',
    function bp_activity_latest_update( $user_id = 0 ) { 
    28952896                 * Filters the latest update excerpt with view link appended to the end.
    28962897                 *
    28972898                 * @since 1.2.0
     2899                 * @since 2.6.0 Added the `$user_id` parameter.
    28982900                 *
    28992901                 * @param string $latest_update The latest update with "view" link appended to it.
     2902                 * @param int    $user_id       ID of the queried user.
    29002903                 */
    2901                 return apply_filters( 'bp_get_activity_latest_update', $latest_update );
     2904                return apply_filters( 'bp_get_activity_latest_update', $latest_update, $user_id );
    29022905        }
    29032906
    29042907/**
    function bp_activity_filter_links( $args = false ) { 
    30103013                 * Filters all of the constructed filter links.
    30113014                 *
    30123015                 * @since 1.1.0
     3016                 * @since 2.6.0 Added the `$r` parameter.
    30133017                 *
    30143018                 * @param string $value All of the links to be displayed to the user.
     3019                 * @param array  $r     Array of parsed arguments.
    30153020                 */
    3016                 return apply_filters( 'bp_get_activity_filter_links', implode( "\n", $component_links ) );
     3021                return apply_filters( 'bp_get_activity_filter_links', implode( "\n", $component_links ), $r );
    30173022        }
    30183023
    30193024/**
    function bp_total_favorite_count_for_user( $user_id = 0 ) { 
    31683173                 * Filters the total favorite count for a user.
    31693174                 *
    31703175                 * @since 1.2.0
     3176                 * @since 2.6.0 Added the `$user_id` parameter.
    31713177                 *
    3172                  * @param int|bool $retval Total favorite count for a user. False on no favorites.
     3178                 * @param int|bool $retval  Total favorite count for a user. False on no favorites.
     3179                 * @param int      $user_id ID of the queried user.
    31733180                 */
    3174                 return apply_filters( 'bp_get_total_favorite_count_for_user', $retval );
     3181                return apply_filters( 'bp_get_total_favorite_count_for_user', $retval, $user_id );
    31753182        }
    31763183
    31773184
    function bp_total_mention_count_for_user( $user_id = 0 ) { 
    32163223                 * Filters the total mention count for a user.
    32173224                 *
    32183225                 * @since 1.2.0
     3226                 * @since 2.6.0 Added the `$user_id` parameter.
    32193227                 *
    3220                  * @param int|bool $retval Total mention count for a user. False on no mentions.
     3228                 * @param int|bool $retval  Total mention count for a user. False on no mentions.
     3229                 * @param int      $user_id ID of the queried user.
    32213230                 */
    3222                 return apply_filters( 'bp_get_total_mention_count_for_user', $retval );
     3231                return apply_filters( 'bp_get_total_mention_count_for_user', $retval, $user_id );
    32233232        }
    32243233
    32253234/**