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
1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 | 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.