bp_get_member_registered( array $args = array() )
Get the ‘registered [x days ago]’ string for the current member.
Description
Parameters
- $args
-
(Optional) Array of optional parameters.
- 'relative'
(bool) Optional. If true, returns relative registered date. eg. registered 5 months ago. If false, returns registered date value from database.
Default value: array()
- 'relative'
Return
(string)
Source
File: bp-members/bp-members-template.php
function bp_get_member_registered( $args = array() ) { global $members_template; $r = wp_parse_args( $args, array( 'relative' => true, ) ); // We do not want relative time, so return now. // @todo Should the 'bp_member_registered' filter be applied here? if ( ! $r['relative'] ) { return esc_attr( $members_template->member->user_registered ); } $registered = esc_attr( bp_core_get_last_activity( $members_template->member->user_registered, _x( 'registered %s', 'Records the timestamp that the user registered into the activity feed', 'buddyboss' ) ) ); /** * Filters the 'registered [x days ago]' string for the current member. * * @since BuddyPress 2.1.0 * * @param string $registered The 'registered [x days ago]' string. */ return apply_filters( 'bp_member_registered', $registered ); }
Changelog
Version | Description |
---|---|
BuddyPress 2.7.0 Added $args as a parameter. | BuddyPress 2.7.0 Added $args as a parameter. |
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.