Ticket #22917: right-now-live.diff
File right-now-live.diff, 2.3 KB (added by , 12 years ago) |
---|
-
wp-includes/ms-functions.php
921 921 delete_user_option( $user_id, 'user_level' ); 922 922 923 923 do_action( 'wpmu_new_user', $user_id ); 924 wp_update_network_user_counts(); //user added, update network counts 924 925 925 926 return $user_id; 926 927 } … … 1149 1150 populate_options(); 1150 1151 populate_roles(); 1151 1152 $wp_roles->_init(); 1153 wp_update_network_blog_counts(); //new blog added, update network counts 1152 1154 1153 1155 $url = untrailingslashit( $url ); 1154 1156 … … 1923 1925 * @since 3.1.0 1924 1926 */ 1925 1927 function wp_update_network_counts() { 1928 wp_update_network_user_counts(); 1929 wp_update_network_blog_counts(); 1930 } 1931 1932 /** 1933 * Update the network-wide counts for users 1934 * 1935 * @since 3.5.2 1936 * 1937 */ 1938 function wp_update_network_user_counts() { 1926 1939 global $wpdb; 1927 1940 1928 $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(blog_id) as c FROM $wpdb->blogs WHERE site_id = %d AND spam = '0' AND deleted = '0' and archived = '0'", $wpdb->siteid) );1929 update_site_option( 'blog_count', $count );1930 1931 1941 $count = $wpdb->get_var( "SELECT COUNT(ID) as c FROM $wpdb->users WHERE spam = '0' AND deleted = '0'" ); 1932 1942 update_site_option( 'user_count', $count ); 1933 1943 } 1934 1944 1935 1945 /** 1946 * Update the network-wide counts for blogs 1947 * 1948 * @since 3.5.2 1949 * 1950 */ 1951 function wp_update_network_blog_counts() { 1952 global $wpdb; 1953 1954 $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(blog_id) as c FROM $wpdb->blogs WHERE site_id = %d AND spam = '0' AND deleted = '0' and archived = '0'", $wpdb->siteid) ); 1955 update_site_option( 'blog_count', $count ); 1956 } 1957 1958 /** 1936 1959 * Returns the space used by the current blog. 1937 1960 * 1938 1961 * @since 3.5.0 -
wp-admin/includes/ms.php
122 122 } 123 123 124 124 clean_blog_cache( $blog ); 125 wp_update_network_blog_counts(); //blog deleted, update network counts 126 125 127 } 126 128 127 129 if ( $switch ) … … 168 170 $wpdb->delete( $wpdb->users, array( 'ID' => $id ) ); 169 171 170 172 clean_user_cache( $user ); 173 wp_update_network_user_counts(); //user deleted, update network counts 171 174 172 175 // allow for commit transaction 173 176 do_action( 'deleted_user', $id );