purposes. * * @param string $name * @return Jetpack_RelatedPosts_Raw */ public function set_query_name( $name ) { $this->_query_name = (string) $name; return $this; } /** * The raw related posts class can be used by other plugins or themes * to get related content. This class wraps the existing RelatedPosts * logic thus we never want to add anything to the DOM or do anything * for event hooks. We will also not present any settings for this * class and keep it enabled as calls to this class is done * programmatically. */ public function action_admin_init() {} public function action_frontend_init() {} public function get_options() { return array( 'enabled' => true, ); } /** * Workhorse method to return array of related posts ids matched by Elasticsearch. * * @param int $post_id * @param int $size * @param array $filters * @uses wp_remote_post, is_wp_error, wp_remote_retrieve_body * @return array */ protected function _get_related_posts( $post_id, $size, array $filters ) { $hits = $this->_filter_non_public_posts( $this->_get_related_post_ids( $post_id, $size, $filters ) ); /** This filter is already documented in modules/related-posts/related-posts.php */ $hits = apply_filters( 'jetpack_relatedposts_filter_hits', $hits, $post_id ); return $hits; } }