mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-04 04:34:31 +00:00
REST API: Allow querying for multiple slug values.
Props jnylen0, rachelbaker. Fixes #38579. git-svn-id: https://develop.svn.wordpress.org/trunk@39093 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -169,7 +169,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
'parent' => 'post_parent__in',
|
||||
'parent_exclude' => 'post_parent__not_in',
|
||||
'search' => 's',
|
||||
'slug' => 'name',
|
||||
'slug' => 'post_name__in',
|
||||
'status' => 'post_status',
|
||||
);
|
||||
|
||||
@@ -882,6 +882,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
'post_parent__not_in',
|
||||
'posts_per_page',
|
||||
'date_query',
|
||||
'post_name__in',
|
||||
);
|
||||
|
||||
$valid_vars = array_merge( $valid_vars, $rest_valid );
|
||||
@@ -2112,9 +2113,9 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
}
|
||||
|
||||
$params['slug'] = array(
|
||||
'description' => __( 'Limit result set to posts with a specific slug.' ),
|
||||
'type' => 'string',
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
'description' => __( 'Limit result set to posts with one or more specific slugs.' ),
|
||||
'type' => 'array',
|
||||
'sanitize_callback' => 'wp_parse_slug_list',
|
||||
);
|
||||
|
||||
$params['status'] = array(
|
||||
|
||||
Reference in New Issue
Block a user