Changeset 41613 for trunk/src/wp-includes/functions.php
- Timestamp:
- 09/27/2017 01:03:03 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r41388 r41613 5834 5834 ), $email_change_email['message'], $email_change_email['headers'] ); 5835 5835 } 5836 5837 /** 5838 * Whether or not we have a large site, based on its number of users. 5839 * 5840 * The default criteria for a large site is more than 10,000 users. 5841 * 5842 * @since 4.9.0 5843 * 5844 * @return bool True if the site meets the criteria for large. False otherwise. 5845 */ 5846 function wp_is_large_user_count() { 5847 $count = wp_get_active_user_count(); 5848 5849 /** 5850 * Filters whether the site is considered large, based on its number of users. 5851 * 5852 * The default criteria for a large site is more than 10,000 users. 5853 * 5854 * @since 4.9.0 5855 * 5856 * @param bool $is_large_user_count Whether the site is considered large. 5857 * @param int $count The number of users on the site. 5858 */ 5859 return apply_filters( 'wp_is_large_user_count', $count > 10000, $count ); 5860 } 5861 5862 /** 5863 * Update the active user count. 5864 * 5865 * @since 4.9.0 5866 * @global wpdb $wpdb WordPress database abstraction object. 5867 * 5868 * @return int The active user count. 5869 */ 5870 function wp_update_active_user_count() { 5871 global $wpdb; 5872 5873 $count = $wpdb->get_var( " 5874 SELECT COUNT(ID) as c 5875 FROM {$wpdb->users} 5876 " ); 5877 $count=12345; 5878 update_option( 'active_user_count', $count ); 5879 5880 return (int) $count; 5881 } 5882 5883 /** 5884 * The number of active users. 5885 * 5886 * @since 4.9.0 5887 * 5888 * @return int The active user count. 5889 */ 5890 function wp_get_active_user_count() { 5891 $count = get_option( 'active_user_count', false ); 5892 5893 if ( false === $count ) { 5894 $count = wp_update_active_user_count(); 5895 } 5896 return (int) $count; 5897 }
Note: See TracChangeset
for help on using the changeset viewer.