Skip to:
Content

BuddyPress.org

Ticket #3022: 3022.02.patch

File 3022.02.patch, 1.2 KB (added by r-a-y, 14 years ago)

Swap out function_exists() call for bp_is_active()

  • bp-xprofile/bp-xprofile-functions.php

     
    9090        }
    9191}
    9292
     93/**
     94 * Adds an activity stream item when a user has uploaded a new avatar.
     95 *
     96 * @package BuddyPress XProfile
     97 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
     98 * @uses bp_activity_add() Adds an entry to the activity component tables for a specific activity
     99 */
     100function xprofile_new_avatar_activity() {
     101        global $bp;
     102
     103        if ( !bp_is_active( 'activity' ) )
     104                return false;
     105
     106        $user_id = apply_filters( 'xprofile_new_avatar_user_id', $bp->displayed_user->id );
     107
     108        $userlink = bp_core_get_userlink( $user_id );
     109
     110        bp_activity_add( array(
     111                'user_id' => $user_id,
     112                'action' => apply_filters( 'xprofile_new_avatar_action', sprintf( __( '%s uploaded a new profile picture', 'buddypress' ), $userlink ), $user_id ),
     113                'component' => 'profile',
     114                'type' => 'new_avatar'
     115        ) );
     116}
     117add_action( 'xprofile_avatar_uploaded', 'xprofile_new_avatar_activity' );
     118
    93119function xprofile_register_activity_action( $key, $value ) {
    94120        global $bp;
    95121