Skip to content

Commit cdf15a9

Browse files
author
Salil Kothadia
authored
Merge pull request #20 from elevati/development
Development
2 parents 268979f + 1f00d27 commit cdf15a9

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,19 @@ public function get_collection_params() {
344344
'default' => array(),
345345
'sanitize_callback' => 'wp_parse_id_list',
346346
'validate_callback' => 'rest_validate_request_arg',
347+
'items' => array(
348+
'type' => 'integer',
349+
),
347350
);
348351
$params['author_exclude'] = array(
349352
'description' => __('Ensure result set excludes posts assigned to specific authors.'),
350353
'type' => 'array',
351354
'default' => array(),
352355
'sanitize_callback' => 'wp_parse_id_list',
353356
'validate_callback' => 'rest_validate_request_arg',
357+
'items' => array(
358+
'type' => 'integer',
359+
),
354360
);
355361

356362
$params['before'] = array(

plugin.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@
1313
/**
1414
* WP_REST_Multiple_PostType_Controller class.
1515
*/
16-
if (!class_exists('WP_REST_Multiple_PostType_Controller')) {
17-
18-
require_once dirname(__FILE__) . '/lib/endpoints/class-wp-rest-multiple-posttype-controller.php';
19-
}
2016

2117
function init_wp_rest_multiple_posttype_endpoint() {
18+
if (!class_exists('WP_REST_Multiple_PostType_Controller')) {
19+
require_once dirname(__FILE__) . '/lib/endpoints/class-wp-rest-multiple-posttype-controller.php';
20+
}
2221
$controller = new WP_REST_Multiple_PostType_Controller();
2322
$controller->register_routes();
2423
}

0 commit comments

Comments
 (0)