diff --git a/wp-includes/functions.php b/wp-includes/functions.php index a06bfe952d..7d4dc450dc 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -108,6 +108,20 @@ function get_lastpostdate() { return $lastpostdate; } +function get_lastpostmodified() { + global $tableposts, $cache_lastpostmodified, $use_cache, $pagenow, $wpdb; + if ((!isset($cache_lastpostmodified)) OR (!$use_cache)) { + $time_difference = get_settings('time_difference'); // for some weird reason the global wasn't set anymore? + $now = date("Y-m-d H:i:s",(time() + ($time_difference * 3600))); + + $lastpostmodified = $wpdb->get_var("SELECT post_modified FROM $tableposts WHERE post_modified <= '$now' AND post_status = 'publish' ORDER BY post_modified DESC LIMIT 1"); + $cache_lastpostmodified = $lastpostmodified; + } else { + $lastpostmodified = $cache_lastpostmodified; + } + return $lastpostmodified; +} + function user_pass_ok($user_login,$user_pass) { global $cache_userdata,$use_cache; if ((empty($cache_userdata[$user_login])) OR (!$use_cache)) {