bp_members_format_activity_action_new_avatar( string $action, object $activity )

Format ‘new_avatar’ activity actions.


Parameters Parameters

$action

(string) (Required) Static activity action.

$activity

(object) (Required) Activity object.


Top ↑

Return Return

(string)


Source Source

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

function bp_members_format_activity_action_new_avatar( $action, $activity ) {
	$userlink = bp_core_get_userlink( $activity->user_id );

	/* translators: %s: user link */
	$action = sprintf( esc_html__( '%s changed their profile picture', 'buddypress' ), $userlink );

	// Legacy filter - pass $user_id instead of $activity.
	if ( has_filter( 'bp_xprofile_new_avatar_action' ) ) {
		$action = apply_filters( 'bp_xprofile_new_avatar_action', $action, $activity->user_id );
	}

	/** This filter is documented in wp-includes/deprecated.php */
	$action = apply_filters_deprecated( 'bp_xprofile_format_activity_action_new_avatar', array( $action, $activity ), '8.0.0', 'bp_members_format_activity_action_new_avatar' );

	/**
	 * Filters the formatted 'new_avatar' activity stream action.
	 *
	 * @since 8.0.0
	 *
	 * @param string $action   Formatted action for activity stream.
	 * @param object $activity Activity object.
	 */
	return apply_filters( 'bp_members_format_activity_action_new_avatar', $action, $activity );
}


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.