From 7086111ad4dd997e12a3220e1ee60c9b9bcf0bb8 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 7 Jan 2020 13:06:14 +0100 Subject: Added wordpress --- .../search/class-wp-rest-search-handler.php | 97 ++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 srcs/wordpress/wp-includes/rest-api/search/class-wp-rest-search-handler.php (limited to 'srcs/wordpress/wp-includes/rest-api/search/class-wp-rest-search-handler.php') diff --git a/srcs/wordpress/wp-includes/rest-api/search/class-wp-rest-search-handler.php b/srcs/wordpress/wp-includes/rest-api/search/class-wp-rest-search-handler.php new file mode 100644 index 0000000..4799e1c --- /dev/null +++ b/srcs/wordpress/wp-includes/rest-api/search/class-wp-rest-search-handler.php @@ -0,0 +1,97 @@ +type; + } + + /** + * Gets the object subtypes managed by this search handler. + * + * @since 5.0.0 + * + * @return array Array of object subtype identifiers. + */ + public function get_subtypes() { + return $this->subtypes; + } + + /** + * Searches the object type content for a given search request. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full REST request. + * @return array Associative array containing an `WP_REST_Search_Handler::RESULT_IDS` containing + * an array of found IDs and `WP_REST_Search_Handler::RESULT_TOTAL` containing the + * total count for the matching search results. + */ + abstract public function search_items( WP_REST_Request $request ); + + /** + * Prepares the search result for a given ID. + * + * @since 5.0.0 + * + * @param int $id Item ID. + * @param array $fields Fields to include for the item. + * @return array Associative array containing all fields for the item. + */ + abstract public function prepare_item( $id, array $fields ); + + /** + * Prepares links for the search result of a given ID. + * + * @since 5.0.0 + * + * @param int $id Item ID. + * @return array Links for the given item. + */ + abstract public function prepare_item_links( $id ); +} -- cgit