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
1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 | 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.