Jetpack_RelatedPosts::_action_frontend_init_ajax PHP Метод

_action_frontend_init_ajax() защищенный Метод

NOTE: Calls exit() to end all further processing after payload has been outputed.
protected _action_frontend_init_ajax ( array $excludes ) : null
$excludes array array of post_ids to exclude
Результат null
    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;
    }