/* users registered date - This month */
function wpb_registered_date_users() { 
global $wpdb;
$recentusers = '<ul class="recently-user">';
$usernames = $wpdb->get_results("SELECT user_nicename, user_login, user_url, user_email, user_registered FROM $wpdb->users ORDER BY ID DESC");
$thisVal = date("Y/m/d");
$Regdate = date("M", strtotime( $thisVal ) );
echo '<br \>';
echo '<li><span><b>' .esc_html($Regdate). '</b></span><span>&nbsp;&nbsp;Registered Users</span></li>';
echo '<br \>';
foreach ($usernames as $username) {
	$date = $username->user_registered;
    $dateVal = substr($date, 0, 10);
	$dateReg = date("M", strtotime( $dateVal ) );
	$str_date = date("Y/m/d");
    $month = date("M", strtotime( $str_date ) );
if($dateReg == $month){
  echo '<div><span>'  . esc_html($username->user_email) . ' :&ensp; ' . esc_html($dateVal) . '</span></div>';
  echo '<hr/>';  
}
}
}
add_shortcode('wpb_register_date', 'wpb_registered_date_users');

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *