bp_get_last_activity( int $user_id )
Get the “active [x days ago]” string for a user.
Description Description
Parameters Parameters
- $user_id
-
(Required) ID of the user. Default: displayed user ID.
Return Return
(string)
Source 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', 'buddypress') ); /** * Filters the 'active [x days ago]' string for a user. * * @since 1.5.0 * @since 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 |
---|---|
1.5.0 | Introduced. |