bp_groups_format_activity_action_group_activity_update( string $action, object $activity )

Format the action for activity updates posted in a Group.


Parameters Parameters

$action

(string) (Required) Static activity action.

$activity

(object) (Required) Activity data object.


Top ↑

Return Return

(string) The formatted action for activity updates posted in a Group.


Source Source

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

function bp_groups_format_activity_action_group_activity_update( $action, $activity ) {
	$user_link = bp_core_get_userlink( $activity->user_id );
	$group     = bp_groups_get_activity_group( $activity->item_id );

	$group_link = '<a href="' . esc_url( bp_get_group_permalink( $group ) ) . '">' . esc_html( $group->name ) . '</a>';

	// Set the Activity update posted in a Group action.
	$action = sprintf(
		/* translators: 1: the user link. 2: the group link. */
		esc_html__( '%1$s posted an update in the group %2$s', 'buddypress' ),
		$user_link,
		$group_link
	);

	/** This filter is documented in wp-includes/deprecated.php */
	$action = apply_filters_deprecated( 'groups_activity_new_update_action', array( $action ), '5.0.0', 'bp_groups_format_activity_action_group_activity_update' );

	/**
	 * Filters the Group's activity update action.
	 *
	 * @since 5.0.0
	 *
	 * @param string $action   The Group's activity update action.
	 * @param object $activity Activity data object.
	 */
	return apply_filters( 'bp_groups_format_activity_action_group_activity_update', $action, $activity );
}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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