Skip to:
Content
Pages
Categories
Search
Top
Bottom

The way to display how many members registered today?

  • Avatar of 4ella
    4ella
    Participant

    @4ella

    Anybody here pls. Do you know the code to display today registered members count, something like:
    20 new members registered today

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of 4ella
    4ella
    Participant

    @4ella

    nobody can help?

    Avatar of 4ella
    4ella
    Participant

    @4ella

    http://wordpress.stackexchange.com helped me:

    function bp_registrations_today($activated = false) {
        global $wpdb;
    
        $query = "SELECT COUNT(ID) FROM {$wpdb->prefix}users WHERE DATE(user_registered) = CURDATE()";
    
        if ( $activated ) {
            $query .= " AND user_status = 0";
        }
    
        return $wpdb->get_var($query);
    }

    To get the number of users registered today, call the function as

    echo bp_registrations_today();

    To get the number of users registered today with activated accounts, call the function as

    echo bp_registrations_today(true);

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.