BP_Members_Admin::user_admin_stats_metabox( WP_User|null $user = null )
Render the Stats metabox to moderate inappropriate images.
Description
Parameters
- $user
-
(Optional) The WP_User object to be edited.
Default value: null
Source
File: bp-members/classes/class-bp-members-admin.php
public function user_admin_stats_metabox( $user = null ) {
// Bail if no user ID.
if ( empty( $user->ID ) ) {
return;
}
// If account is not activated last activity is the time user registered.
if ( isset( $user->user_status ) && 2 == $user->user_status ) {
$last_active = $user->user_registered;
// Account is activated, getting user's last activity.
} else {
$last_active = bp_get_user_last_activity( $user->ID );
}
$datef = __( 'M j, Y @ G:i', 'buddyboss' );
$date = date_i18n( $datef, strtotime( $last_active ) ); ?>
<ul>
<li class="bp-members-profile-stats"><?php printf( __( 'Last active: %1$s', 'buddyboss' ), '<strong>' . $date . '</strong>' ); ?></li>
<?php
// Loading other stats only if user has activated their account.
if ( empty( $user->user_status ) ) {
/**
* Fires in the user stats metabox if the user has activated their account.
*
* @since BuddyPress 2.0.0
*
* @param array $value Array holding the user ID.
* @param object $user Current displayed user object.
*/
do_action( 'bp_members_admin_user_stats', array( 'user_id' => $user->ID ), $user );
}
?>
</ul>
<?php
}
Changelog
| Version | Description |
|---|---|
| BuddyPress 2.0.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.