private function get_synced_status_for($post)
{
$remote_id = get_post_meta($post->ID, 'apple_news_api_id', true);
if (!$remote_id) {
// There is no remote id, check for a delete mark
$deleted = get_post_meta($post->ID, 'apple_news_api_deleted', true);
if ($deleted) {
return __('Deleted', 'apple-news');
}
$pending = get_post_meta($post->ID, 'apple_news_api_pending', true);
if ($pending) {
return __('Pending', 'apple-news');
}
// No delete mark, this has not been published yet.
return __('Not published', 'apple-news');
}
$updated = get_post_meta($post->ID, 'apple_news_api_modified_at', true);
$updated = strtotime(get_date_from_gmt(date('Y-m-d H:i:s', strtotime($updated))));
$local = strtotime($post->post_modified);
if ($local > $updated) {
return __('Needs to be updated', 'apple-news');
}
return __('Published', 'apple-news');
}