WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/17/2018 05:02:04 PM (8 months ago)
Author:
danielbachhuber
Message:

REST API: Introduce controller for searching across post types.

Introduces a WP_REST_Search_Controller class which registers a /wp/v2/search endpoint. Search types are handled by extending WP_REST_Search_Handler. The default search type is WP_REST_Post_Search_Handler but can be filtered by plugins or a theme.

Props danielbachhuber, flixos90, pento, rmccue.
Fixes #39965.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-settings.php

    r43734 r43739  
    234234require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-users-controller.php' );
    235235require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-comments-controller.php' );
     236require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-search-controller.php' );
    236237require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-settings-controller.php' );
    237238require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-themes-controller.php' );
     
    241242require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-term-meta-fields.php' );
    242243require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-user-meta-fields.php' );
     244require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-search-handler.php' );
     245require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-post-search-handler.php' );
    243246
    244247$GLOBALS['wp_embed'] = new WP_Embed();
Note: See TracChangeset for help on using the changeset viewer.