| Server IP : 172.67.134.116 / Your IP : 216.73.217.123 Web Server : Apache System : Linux server.rehabsharif.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64 User : nobi37te ( 1003) PHP Version : 8.2.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/nobi37te/public_html/wp-content/plugins/buddyboss-platform/cli/components/ |
Upload File : |
<?php
namespace Buddypress\CLI\Command;
if ( ! class_exists( 'User_Command' ) ) {
require_once WP_CLI_ROOT . '/php/commands/user.php';
}
/**
* Manage BuddyPress Members
*
* @since BuddyPress 1.0.0
*/
class Member extends BuddypressCommand {
/**
* Generate BuddyPress members. See documentation for `wp_user_generate`.
*
* This is a kludge workaround for setting last activity. Should fix.
*
* ## OPTIONS
*
* [--count=<number>]
* : How many members to generate.
* ---
* default: 100
* ---
*
* ## EXAMPLE
*
* $ wp bp member generate --count=50
*/
public function generate( $args, $assoc_args ) {
add_action( 'user_register', array( __CLASS__, 'update_user_last_activity_random' ) );
User_Command::generate( $args, $assoc_args );
}
/**
* Update the last user activity with a random date.
*
* @since BuddyPress 1.0
*
* @param int $user_id User ID.
*/
public static function update_user_last_activity_random( $user_id ) {
$time = date( 'Y-m-d H:i:s', rand( 0, time() ) );
bp_update_user_last_activity( $user_id, $time );
}
}