bp_get_last_activity( int $user_id )

Get the “active [x days ago]” string for a user.

Description

Parameters

$user_id

(Required) ID of the user. Default: displayed user ID.

Return

(string)

Source

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

	function bp_get_last_activity( $user_id = 0 ) {

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

		$last_activity = bp_core_get_last_activity( bp_get_user_last_activity( $user_id ), __('active %s', 'buddyboss') );

		/**
		 * Filters the 'active [x days ago]' string for a user.
		 *
		 * @since BuddyPress 1.5.0
		 * @since BuddyPress 2.6.0 Added the `$user_id` parameter.
		 *
		 * @param string $value   Formatted 'active [x days ago]' string.
		 * @param int    $user_id ID of the user.
		 */
		return apply_filters( 'bp_get_last_activity', $last_activity, $user_id );
	}

Changelog

Changelog
Version Description
BuddyPress 1.5.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.