Skip to content

Commit 62a03f2

Browse files
author
Salil Kothadia
authored
Merge pull request #6 from elevati/development
API Params Validation to return proper status instead of 500
2 parents 192fd43 + 032f8b4 commit 62a03f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/endpoints/class-wp-rest-multiple-posttype-controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function get_items($request) {
6969

7070
# Param Validation
7171
if (empty($args['post_type']) || !is_array($args['post_type'])) {
72-
return new WP_Error('type_need_to_be_array', 'Type Param is a required parameter and needs to be an array: &type[]=post&type[]=page&type[]=slideshow');
72+
return new WP_Error('type_need_to_be_array', 'Type Param is a required parameter and needs to be an array: &type[]=post&type[]=page&type[]=slideshow', ['status' => 422]);
7373
}
7474

7575
$args['date_query'] = array();

0 commit comments

Comments
 (0)