protected function _action_frontend_init_ajax(array $excludes)
{
define('DOING_AJAX', true);
header('Content-type: application/json; charset=utf-8');
// JSON can only be UTF-8
send_nosniff_header();
$related_posts = $this->get_for_post_id(get_the_ID(), array('exclude_post_ids' => $excludes));
$options = $this->get_options();
$response = array('version' => self::VERSION, 'show_thumbnails' => (bool) $options['show_thumbnails'], 'items' => array());
if (count($related_posts) == $options['size']) {
$response['items'] = $related_posts;
}
echo json_encode($response);
exit;
}