Apple_Actions\Index\Push::is_post_in_sync PHP Method

is_post_in_sync() private method

Check if the post is in sync before updating in Apple News.
private is_post_in_sync ( ) : boolean
return boolean
    private function is_post_in_sync()
    {
        $post = get_post($this->id);
        if (!$post) {
            throw new \Apple_Actions\Action_Exception(__('Could not find post with id ', 'apple-news') . $this->id);
        }
        $api_time = get_post_meta($this->id, 'apple_news_api_modified_at', true);
        $api_time = strtotime(get_date_from_gmt(date('Y-m-d H:i:s', strtotime($api_time))));
        $local_time = strtotime($post->post_modified);
        $in_sync = $api_time >= $local_time;
        return apply_filters('apple_news_is_post_in_sync', $in_sync, $this->id, $api_time, $local_time);
    }