Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions lib/endpoints/class-wp-rest-taxonomies-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
11 changes: 9 additions & 2 deletions lib/endpoints/class-wp-rest-terms-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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.' ),
Expand All @@ -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;
}
Expand Down