diff --git src/bp-activity/bp-activity-loader.php src/bp-activity/bp-activity-loader.php
index c8a3e35..179324b 100644
|
|
|
class BP_Activity_Component extends BP_Component {
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | // Favorite activity items |
| 190 | | $sub_nav[] = array( |
| 191 | | 'name' => _x( 'Favorites', 'Profile activity screen sub nav', 'buddypress' ), |
| 192 | | 'slug' => 'favorites', |
| 193 | | 'parent_url' => $activity_link, |
| 194 | | 'parent_slug' => $this->slug, |
| 195 | | 'screen_function' => 'bp_activity_screen_favorites', |
| 196 | | 'position' => 30, |
| 197 | | 'item_css_id' => 'activity-favs' |
| 198 | | ); |
| | 190 | if ( bp_activity_can_favorite() ) { |
| | 191 | $sub_nav[] = array( |
| | 192 | 'name' => _x( 'Favorites', 'Profile activity screen sub nav', 'buddypress' ), |
| | 193 | 'slug' => 'favorites', |
| | 194 | 'parent_url' => $activity_link, |
| | 195 | 'parent_slug' => $this->slug, |
| | 196 | 'screen_function' => 'bp_activity_screen_favorites', |
| | 197 | 'position' => 30, |
| | 198 | 'item_css_id' => 'activity-favs' |
| | 199 | ); |
| | 200 | } |
| 199 | 201 | |
| 200 | 202 | // Additional menu if friends is active |
| 201 | 203 | if ( bp_is_active( 'friends' ) ) { |
| … |
… |
class BP_Activity_Component extends BP_Component {
|
| 291 | 293 | } |
| 292 | 294 | |
| 293 | 295 | // Favorites |
| 294 | | $wp_admin_nav[] = array( |
| 295 | | 'parent' => 'my-account-' . $this->id, |
| 296 | | 'id' => 'my-account-' . $this->id . '-favorites', |
| 297 | | 'title' => _x( 'Favorites', 'My Account Activity sub nav', 'buddypress' ), |
| 298 | | 'href' => trailingslashit( $activity_link . 'favorites' ) |
| 299 | | ); |
| | 296 | // Favorite activity items |
| | 297 | if ( bp_activity_can_favorite() ) { |
| | 298 | $wp_admin_nav[] = array( |
| | 299 | 'parent' => 'my-account-' . $this->id, |
| | 300 | 'id' => 'my-account-' . $this->id . '-favorites', |
| | 301 | 'title' => _x( 'Favorites', 'My Account Activity sub nav', 'buddypress' ), |
| | 302 | 'href' => trailingslashit( $activity_link . 'favorites' ) |
| | 303 | ); |
| | 304 | } |
| 300 | 305 | |
| 301 | 306 | // Friends? |
| 302 | 307 | if ( bp_is_active( 'friends' ) ) { |
diff --git src/bp-activity/bp-activity-template.php src/bp-activity/bp-activity-template.php
index 746a779..f607b68 100644
|
|
|
function bp_total_favorite_count_for_user( $user_id = 0 ) {
|
| 3385 | 3385 | * @return int The total favorite count for the specified user. |
| 3386 | 3386 | */ |
| 3387 | 3387 | function bp_get_total_favorite_count_for_user( $user_id = 0 ) { |
| | 3388 | $retval = false; |
| 3388 | 3389 | |
| 3389 | | // Default to displayed user if none is passed |
| 3390 | | $user_id = empty( $user_id ) |
| 3391 | | ? bp_displayed_user_id() |
| 3392 | | : $user_id; |
| | 3390 | if ( bp_activity_can_favorite() ) { |
| | 3391 | // Default to displayed user if none is passed |
| | 3392 | $user_id = empty( $user_id ) |
| | 3393 | ? bp_displayed_user_id() |
| | 3394 | : $user_id; |
| 3393 | 3395 | |
| 3394 | | // Get user meta if user ID exists |
| 3395 | | $retval = ! empty( $user_id ) |
| 3396 | | ? bp_activity_total_favorites_for_user( $user_id ) |
| 3397 | | : false; |
| | 3396 | // Get user meta if user ID exists |
| | 3397 | if ( ! empty( $user_id ) ) { |
| | 3398 | $retval = bp_activity_total_favorites_for_user( $user_id ); |
| | 3399 | } |
| | 3400 | } |
| 3398 | 3401 | |
| 3399 | 3402 | /** |
| 3400 | 3403 | * Filters the total favorite count for a user. |