BP_Members_Admin::user_admin_stats_metabox( WP_User|null $user = null )

Render the Stats metabox to moderate inappropriate images.


Description Description


Parameters Parameters

$user

(Optional) The WP_User object to be edited.

Default value: null


Top ↑

Source 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', 'buddypress' );
		$date  = date_i18n( $datef, strtotime( $last_active ) ); ?>

		<ul>
			<li class="bp-members-profile-stats"><?php printf( __( 'Last active: %1$s', 'buddypress' ), '<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 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
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.