bp_get_activity_latest_update( int $user_id )

Return the activity latest update link.

Description

Parameters

$user_id

(int) (Required) If empty, will fall back on displayed user.

Return

(string|bool) $latest_update The activity latest update link. False on failure.

Source

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

	function bp_get_activity_latest_update( $user_id = 0 ) {

		if ( empty( $user_id ) ) {
			$user_id = bp_displayed_user_id();
		}

		if ( bp_is_user_inactive( $user_id ) ) {
			return false;
		}

		if ( !$update = bp_get_user_meta( $user_id, 'bp_latest_update', true ) ) {
			return false;
		}

		/**
		 * Filters the latest update excerpt.
		 *
		 * @since BuddyPress 1.2.10
		 * @since BuddyPress 2.6.0  Added the `$user_id` parameter.
		 *
		 * @param string $value   The excerpt for the latest update.
		 * @param int    $user_id ID of the queried user.
		 */
		$latest_update = apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], bp_activity_get_excerpt_length() ) ) ), $user_id );

		$latest_update = sprintf(
			'%s <a href="%s">%s</a>',
			$latest_update,
			esc_url_raw( bp_activity_get_permalink( $update['id'] ) ),
			esc_attr__( 'View', 'buddyboss' )
		);

		/**
		 * Filters the latest update excerpt with view link appended to the end.
		 *
		 * @since BuddyPress 1.2.0
		 * @since BuddyPress 2.6.0 Added the `$user_id` parameter.
		 *
		 * @param string $latest_update The latest update with "view" link appended to it.
		 * @param int    $user_id       ID of the queried user.
		 */
		return apply_filters( 'bp_get_activity_latest_update', $latest_update, $user_id );
	}

Changelog

Changelog
Version Description
BuddyPress 1.2.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.