| 3781 | | if ( !isset($cache_lastpostmodified[$blog_id][$timezone]) ) { |
| 3782 | | switch(strtolower($timezone)) { |
| 3783 | | case 'gmt': |
| 3784 | | $lastpostmodified = $wpdb->get_var("SELECT post_modified_gmt FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_modified_gmt DESC LIMIT 1"); |
| 3785 | | break; |
| 3786 | | case 'blog': |
| 3787 | | $lastpostmodified = $wpdb->get_var("SELECT post_modified FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_modified_gmt DESC LIMIT 1"); |
| 3788 | | break; |
| 3789 | | case 'server': |
| 3790 | | $lastpostmodified = $wpdb->get_var("SELECT DATE_ADD(post_modified_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_modified_gmt DESC LIMIT 1"); |
| 3791 | | break; |
| 3792 | | } |
| 3793 | | $lastpostdate = get_lastpostdate($timezone); |
| 3794 | | if ( $lastpostdate > $lastpostmodified ) { |
| 3795 | | $lastpostmodified = $lastpostdate; |
| 3796 | | } |
| 3797 | | $cache_lastpostmodified[$blog_id][$timezone] = $lastpostmodified; |
| 3798 | | } else { |
| 3799 | | $lastpostmodified = $cache_lastpostmodified[$blog_id][$timezone]; |
| | 3780 | $timezone = strtolower( $timezone ); |
| | 3781 | |
| | 3782 | $lastpostmodified = wp_cache_get( "lastpostmodified:$timezone", 'timeinfo' ); |
| | 3783 | if ( $lastpostmodified ) |
| | 3784 | return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone ); |
| | 3785 | |
| | 3786 | switch ( strtolower($timezone) ) { |
| | 3787 | case 'gmt': |
| | 3788 | $lastpostmodified = $wpdb->get_var("SELECT post_modified_gmt FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_modified_gmt DESC LIMIT 1"); |
| | 3789 | break; |
| | 3790 | case 'blog': |
| | 3791 | $lastpostmodified = $wpdb->get_var("SELECT post_modified FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_modified_gmt DESC LIMIT 1"); |
| | 3792 | break; |
| | 3793 | case 'server': |
| | 3794 | $lastpostmodified = $wpdb->get_var("SELECT DATE_ADD(post_modified_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_modified_gmt DESC LIMIT 1"); |
| | 3795 | break; |