Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/endpoints/class-wp-rest-posts-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,7 @@ public function get_collection_params() {
'type' => 'integer',
'default' => null,
'sanitize_callback' => 'absint',
'validate_callback' => 'rest_validate_request_arg',
);
}
$params['exclude'] = array(
Expand All @@ -1591,12 +1592,14 @@ 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',
);
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.' ),
Expand All @@ -1609,6 +1612,7 @@ public function get_collection_params() {
'title',
'slug',
),
'validate_callback' => 'rest_validate_request_arg',
);

$post_type_obj = get_post_type_object( $this->post_type );
Expand All @@ -1630,6 +1634,7 @@ public function get_collection_params() {
$params['slug'] = array(
'description' => __( 'Limit result set to posts with a specific slug.' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
$params['status'] = array(
'default' => 'publish',
Expand Down