Ticket #13773: get_most_active_blogs.patch
File get_most_active_blogs.patch, 956 bytes (added by , 15 years ago) |
---|
-
wp-includes/ms-functions.php
159 159 } 160 160 161 161 function get_most_active_blogs( $num = 10, $display = true ) { 162 $most_active = get_site_ option( 'most_active' );162 $most_active = get_site_transient( 'most_active' ); 163 163 $update = false; 164 if ( is_array( $most_active ) ) { 165 if ( ( $most_active['time'] + 60 ) < time() ) { // cache for 60 seconds. 166 $update = true; 167 } 168 } else { 164 if ( empty( $most_active ) || ! is_array( $most_active ) ) 169 165 $update = true; 170 }171 166 172 167 if ( $update == true ) { 173 168 unset( $most_active ); … … 186 181 unset( $most_active ); 187 182 $most_active = $t; 188 183 } 189 update_site_option( 'most_active', $most_active );184 set_site_transient( 'most_active', $most_active, 60 ); // cache for 60 seconds. 190 185 } 191 186 192 187 if ( $display == true ) {