bp_members_new_avatar_activity( int $user_id )

Adds an activity stream item when a user has uploaded a new avatar.


Parameters Parameters

$user_id

(int) (Required) The user id the avatar was set for.


Source Source

File: bp-members/bp-members-activity.php

function bp_members_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();
	}

	/** This filter is documented in wp-includes/deprecated.php */
	$user_id = apply_filters_deprecated( 'bp_xprofile_new_avatar_user_id', array( $user_id ), '8.0.0', 'bp_members_new_avatar_user_id' );

	/**
	 * Filters the user ID when a user has uploaded a new avatar.
	 *
	 * @since 8.0.0
	 *
	 * @param int $user_id ID of the user the avatar was set for.
	 */
	$user_id = apply_filters( 'bp_members_new_avatar_user_id', $user_id );

	// Add the activity.
	bp_activity_add( array(
		'user_id'   => $user_id,
		'component' => buddypress()->members->id,
		'type'      => 'new_avatar'
	) );
}


Top ↑

Changelog Changelog

Changelog
Version Description
8.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.