Changeset 44107
- Timestamp:
- 12/13/2018 09:37:05 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/5.0 merged: 43739,43741
- Property svn:mergeinfo changed
-
trunk/src/wp-includes/rest-api.php
r43985 r44107 229 229 // Comments. 230 230 $controller = new WP_REST_Comments_Controller; 231 $controller->register_routes(); 232 233 /** 234 * Filters the search handlers to use in the REST search controller. 235 * 236 * @since 5.0.0 237 * 238 * @param array $search_handlers List of search handlers to use in the controller. Each search 239 * handler instance must extend the `WP_REST_Search_Handler` class. 240 * Default is only a handler for posts. 241 */ 242 $search_handlers = apply_filters( 'wp_rest_search_handlers', array( new WP_REST_Post_Search_Handler() ) ); 243 244 $controller = new WP_REST_Search_Controller( $search_handlers ); 231 245 $controller->register_routes(); 232 246 -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php
r43739 r44107 71 71 72 72 /* 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' ); 74 74 continue; 75 75 } -
trunk/src/wp-settings.php
r43985 r44107 235 235 require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-users-controller.php' ); 236 236 require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-comments-controller.php' ); 237 require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-search-controller.php' ); 237 238 require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-settings-controller.php' ); 238 239 require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-themes-controller.php' ); … … 242 243 require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-term-meta-fields.php' ); 243 244 require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-user-meta-fields.php' ); 245 require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-search-handler.php' ); 246 require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-post-search-handler.php' ); 244 247 245 248 $GLOBALS['wp_embed'] = new WP_Embed(); -
trunk/tests/phpunit/includes/bootstrap.php
r43369 r44107 133 133 require dirname( __FILE__ ) . '/utils.php'; 134 134 require dirname( __FILE__ ) . '/spy-rest-server.php'; 135 require dirname( __FILE__ ) . '/class-wp-rest-test-search-handler.php'; 135 136 136 137 /** -
trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php
r43985 r44107 111 111 '/wp/v2/comments', 112 112 '/wp/v2/comments/(?P<id>[\\d]+)', 113 '/wp/v2/search', 113 114 '/wp/v2/settings', 114 115 '/wp/v2/themes', -
trunk/tests/qunit/fixtures/wp-api-generated.js
r43985 r44107 3409 3409 } 3410 3410 ] 3411 }, 3412 "/wp/v2/search": { 3413 "namespace": "wp/v2", 3414 "methods": [ 3415 "GET" 3416 ], 3417 "endpoints": [ 3418 { 3419 "methods": [ 3420 "GET" 3421 ], 3422 "args": { 3423 "context": { 3424 "required": false, 3425 "default": "view", 3426 "enum": [ 3427 "view", 3428 "embed" 3429 ], 3430 "description": "Scope under which the request is made; determines fields present in response.", 3431 "type": "string" 3432 }, 3433 "page": { 3434 "required": false, 3435 "default": 1, 3436 "description": "Current page of the collection.", 3437 "type": "integer" 3438 }, 3439 "per_page": { 3440 "required": false, 3441 "default": 10, 3442 "description": "Maximum number of items to be returned in result set.", 3443 "type": "integer" 3444 }, 3445 "search": { 3446 "required": false, 3447 "description": "Limit results to those matching a string.", 3448 "type": "string" 3449 }, 3450 "type": { 3451 "required": false, 3452 "default": "post", 3453 "enum": [ 3454 "post" 3455 ], 3456 "description": "Limit results to items of an object type.", 3457 "type": "string" 3458 }, 3459 "subtype": { 3460 "required": false, 3461 "default": "any", 3462 "description": "Limit results to items of one or more object subtypes.", 3463 "type": "array", 3464 "items": { 3465 "enum": [ 3466 "post", 3467 "page", 3468 "any" 3469 ], 3470 "type": "string" 3471 } 3472 } 3473 } 3474 } 3475 ], 3476 "_links": { 3477 "self": "http://example.org/index.php?rest_route=/wp/v2/search" 3478 } 3411 3479 }, 3412 3480 "/wp/v2/settings": {
Note: See TracChangeset
for help on using the changeset viewer.