diff --git a/lib/endpoints/class-wp-rest-taxonomies-controller.php b/lib/endpoints/class-wp-rest-taxonomies-controller.php index 9f38c94992..df69140239 100755 --- a/lib/endpoints/class-wp-rest-taxonomies-controller.php +++ b/lib/endpoints/class-wp-rest-taxonomies-controller.php @@ -205,6 +205,7 @@ public function get_collection_params() { $new_params['type'] = array( 'description' => __( 'Limit results to resources associated with a specific post type.' ), 'type' => 'string', + 'validate_callback' => 'rest_validate_request_arg', ); return $new_params; } diff --git a/lib/endpoints/class-wp-rest-terms-controller.php b/lib/endpoints/class-wp-rest-terms-controller.php index 075b17a50e..8586cf90c4 100755 --- a/lib/endpoints/class-wp-rest-terms-controller.php +++ b/lib/endpoints/class-wp-rest-terms-controller.php @@ -635,6 +635,7 @@ public function get_collection_params() { 'description' => __( 'Offset the result set by a specific number of items.' ), 'type' => 'integer', 'sanitize_callback' => 'absint', + 'validate_callback' => 'rest_validate_request_arg', ); } $query_params['order'] = array( @@ -646,6 +647,7 @@ public function get_collection_params() { 'asc', 'desc', ), + 'validate_callback' => 'rest_validate_request_arg', ); $query_params['orderby'] = array( 'description' => __( 'Sort collection by resource attribute.' ), @@ -661,27 +663,32 @@ public function get_collection_params() { 'description', 'count', ), + 'validate_callback' => 'rest_validate_request_arg', ); $query_params['hide_empty'] = array( 'description' => __( 'Whether to hide resources not assigned to any posts.' ), 'type' => 'boolean', 'default' => false, + 'validate_callback' => 'rest_validate_request_arg', ); if ( $taxonomy->hierarchical ) { $query_params['parent'] = array( 'description' => __( 'Limit result set to resources assigned to a specific parent.' ), 'type' => 'integer', 'sanitize_callback' => 'absint', + 'validate_callback' => 'rest_validate_request_arg', ); } $query_params['post'] = array( 'description' => __( 'Limit result set to resources assigned to a specific post.' ), - 'type' => 'number', - 'default' => false, + 'type' => 'integer', + 'default' => null, + 'validate_callback' => 'rest_validate_request_arg', ); $query_params['slug'] = array( 'description' => __( 'Limit result set to resources with a specific slug.' ), 'type' => 'string', + 'validate_callback' => 'rest_validate_request_arg', ); return $query_params; }