WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/13/2018 09:37:05 AM (14 months ago)
Author:
pento
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.

Merges [43739,43741] from the 5.0 branch to trunk.

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-settings.php

    r43985 r44107  
    235235require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-users-controller.php' );
    236236require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-comments-controller.php' );
     237require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-search-controller.php' );
    237238require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-settings-controller.php' );
    238239require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-themes-controller.php' );
     
    242243require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-term-meta-fields.php' );
    243244require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-user-meta-fields.php' );
     245require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-search-handler.php' );
     246require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-post-search-handler.php' );
    244247
    245248$GLOBALS['wp_embed'] = new WP_Embed();
Note: See TracChangeset for help on using the changeset viewer.