public function get_post($post_id) { $index = ep_get_index_name(); $path = $index . '/post/' . $post_id; $request_args = array('method' => 'GET'); $request = ep_remote_request($path, apply_filters('ep_get_post_request_args', $request_args, $post_id)); if (!is_wp_error($request)) { $response_body = wp_remote_retrieve_body($request); $response = json_decode($response_body, true); if (!empty($response['exists']) || !empty($response['found'])) { return $response['_source']; } } return false; }