Changeset 16537 for trunk/wp-includes/post.php
- Timestamp:
- 11/22/2010 09:45:45 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r16535 r16537 4172 4172 return false; 4173 4173 4174 $post_types = get_query_var('post_type'); 4175 if ( empty($post_types) ) 4176 $post_types = 'post'; 4177 4178 $post_types = apply_filters( "get_lastpost{$field}_post_types", (array) $post_types ); 4179 4180 $key = "lastpost{$field}:" . get_current_blog_id() . ":$timezone:" . md5( serialize( $post_types ) ); 4174 $timezone = strtolower( $timezone ); 4175 4176 $key = "lastpost{$field}:$timezone"; 4181 4177 4182 4178 $date = wp_cache_get( $key, 'timeinfo' ); … … 4185 4181 $add_seconds_server = date('Z'); 4186 4182 4183 $post_types = get_post_types( array( 'publicly_queryable' => true ) ); 4187 4184 array_walk( $post_types, array( &$wpdb, 'escape_by_ref' ) ); 4188 4185 $post_types = "'" . implode( "', '", $post_types ) . "'"; 4189 4186 4190 switch ( strtolower( $timezone )) {4187 switch ( $timezone ) { 4191 4188 case 'gmt': 4192 4189 $date = $wpdb->get_var("SELECT post_{$field}_gmt FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt DESC LIMIT 1"); … … 4451 4448 // If published posts changed clear the lastpostmodified cache 4452 4449 if ( 'publish' == $new_status || 'publish' == $old_status) { 4453 wp_cache_delete( 'lastpostmodified:server', 'timeinfo' ); 4454 wp_cache_delete( 'lastpostmodified:gmt', 'timeinfo' ); 4455 wp_cache_delete( 'lastpostmodified:blog', 'timeinfo' ); 4450 foreach ( array( 'server', 'gmt', 'blog' ) as $timezone ) { 4451 wp_cache_delete( "lastpostmodified:$timezone", 'timeinfo' ); 4452 wp_cache_delete( "lastpostdate:$timezone", 'timeinfo' ); 4453 } 4456 4454 } 4457 4455
Note: See TracChangeset
for help on using the changeset viewer.