Last modified TimeStamp in posts table

Last modified TimeStamp in posts table

Last modified TimeStamp in posts table

 public function get_max_timestamp() {
  global $wpdb;
  $querystr = "SELECT MAX($wpdb->posts.post_modified) as MaxD FROM $wpdb->posts";
  $pageposts = $wpdb->get_results($querystr, OBJECT);

  if ($pageposts ) {
	global $post; 
	$strTimeStamp = "";
	foreach ($pageposts as $post):  
		$strTimeStamp=$post->MaxD;		
	endforeach;  

	return array("max_time_stamp" => $strTimeStamp);
	} else {
	$json_api->error("Include 'post_ID' var in your request.");
   } 

  return null;
}

2 thoughts on “Last modified TimeStamp in posts table

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *