Warning: This function has been deprecated.
bp_xprofile_new_avatar_activity( int $user_id )
Adds an activity stream item when a user has uploaded a new avatar.
Description Description
Parameters Parameters
- $user_id
-
(Required) The user id the avatar was set for.
Return Return
(bool)
Source Source
File: bp-core/deprecated/8.0.php
function bp_xprofile_new_avatar_activity( $user_id = 0 ) {
// Bail if activity component is not active.
if ( ! bp_is_active( 'activity' ) ) {
return false;
}
if ( empty( $user_id ) ) {
$user_id = bp_displayed_user_id();
}
/**
* Filters the user ID when a user has uploaded a new avatar.
*
* @since 1.5.0
*
* @param int $user_id ID of the user the avatar was set for.
*/
$user_id = apply_filters( 'bp_xprofile_new_avatar_user_id', $user_id );
// Add the activity.
bp_activity_add( array(
'user_id' => $user_id,
'component' => 'profile',
'type' => 'new_avatar'
) );
}
Changelog Changelog
| Version | Description |
|---|---|
| 8.0.0 | This function has been deprecated. |
| 2.3.4 | Add new parameter to get the user id the avatar was set for. |
| 1.0.0 | Introduced. |