Make WordPress Core


Ignore:
Timestamp:
10/04/2017 10:16:21 PM (8 years ago)
Author:
johnbillion
Message:

Users: Revert [41613], [41614], and [41623] as this feature needs some more work.

See #38741

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r41692 r41753  
    58385838    ), $email_change_email['message'], $email_change_email['headers'] );
    58395839}
    5840 
    5841 /**
    5842  * Whether or not we have a large site, based on its number of users.
    5843  *
    5844  * The default criteria for a large site is more than 10,000 users.
    5845  *
    5846  * @since 4.9.0
    5847  *
    5848  * @return bool True if the site meets the criteria for large. False otherwise.
    5849  */
    5850 function wp_is_large_user_count() {
    5851     $count = wp_get_active_user_count();
    5852 
    5853     /**
    5854      * Filters whether the site is considered large, based on its number of users.
    5855      *
    5856      * The default criteria for a large site is more than 10,000 users.
    5857      *
    5858      * @since 4.9.0
    5859      *
    5860      * @param bool $is_large_user_count Whether the site is considered large.
    5861      * @param int  $count               The number of users on the site.
    5862      */
    5863     return apply_filters( 'wp_is_large_user_count', $count > 10000, $count );
    5864 }
    5865 
    5866 /**
    5867  * Update the active user count.
    5868  *
    5869  * @since 4.9.0
    5870  * @global wpdb $wpdb WordPress database abstraction object.
    5871  *
    5872  * @return int The active user count.
    5873  */
    5874 function wp_update_active_user_count() {
    5875     global $wpdb;
    5876 
    5877     $count = $wpdb->get_var( "
    5878         SELECT COUNT(ID) as c
    5879         FROM {$wpdb->users}
    5880     " );
    5881     update_option( 'active_user_count', $count );
    5882 
    5883     return (int) $count;
    5884 }
    5885 
    5886 /**
    5887  * The number of active users.
    5888  *
    5889  * @since 4.9.0
    5890  *
    5891  * @return int The active user count.
    5892  */
    5893 function wp_get_active_user_count() {
    5894     $count = get_option( 'active_user_count', false );
    5895 
    5896     if ( false === $count ) {
    5897         $count = wp_update_active_user_count();
    5898     }
    5899     return (int) $count;
    5900 }
Note: See TracChangeset for help on using the changeset viewer.