
Originally Posted by
Frumph
^ awesome, however does this add to the wp_cache_set so that the feed retains it's cache'ing or will this happen every feed load?
PHP Code:
add_filter('get_lastpostmodified', 'my_lastpostmodified');
function my_lastpostmodified()
{
$lastpostmodified = wp_cache_get( "lastpostmodified:custom:server", 'timeinfo' );
if ( $lastpostmodified ) return $lastpostmodified;
global $wpdb;
$add_seconds_server = date('Z');
$lastpostmodified = $wpdb->get_var("SELECT DATE_ADD(post_modified_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_modified_gmt DESC LIMIT 1");
wp_cache_set( "lastpostmodified:custom:server", $lastpostmodified, 'timeinfo' );
return $lastpostmodified;
}