Skip to:
Content

BuddyPress.org

Changeset 7129


Ignore:
Timestamp:
05/29/2013 02:41:53 AM (11 years ago)
Author:
boonebgorges
Message:

Fall back on displayed user id in some activity template functions

In bp_get_total_favorite_count_for_user() and
bp_get_total_mention_count_for_user(), it's convenient to default to the
displayed user id when no id is passed manually.

Fixes #4998

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-template.php

    r7057 r7129  
    24012401     */
    24022402    function bp_get_total_favorite_count_for_user( $user_id = 0 ) {
     2403        if ( ! $user_id ) {
     2404            $user_id = bp_displayed_user_id();
     2405        }
     2406
    24032407        return apply_filters( 'bp_get_total_favorite_count_for_user', bp_activity_total_favorites_for_user( $user_id ) );
    24042408    }
     
    24282432     */
    24292433    function bp_get_total_mention_count_for_user( $user_id = 0 ) {
     2434        if ( ! $user_id ) {
     2435            $user_id = bp_displayed_user_id();
     2436        }
     2437
    24302438        return apply_filters( 'bp_get_total_mention_count_for_user', bp_get_user_meta( $user_id, 'bp_new_mention_count', true ) );
    24312439    }
Note: See TracChangeset for help on using the changeset viewer.