Make WordPress Core


Ignore:
Timestamp:
12/13/2018 09:37:05 AM (5 years 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:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php

    r43739 r44107  
    7171
    7272                /* translators: %s: PHP class name */
    73                 _doing_it_wrong( __METHOD__, sprintf( __( 'REST search handlers must extend the %s class.' ), 'WP_REST_Search_Handler' ), '5.5.0' );
     73                _doing_it_wrong( __METHOD__, sprintf( __( 'REST search handlers must extend the %s class.' ), 'WP_REST_Search_Handler' ), '5.0.0' );
    7474                continue;
    7575            }
Note: See TracChangeset for help on using the changeset viewer.