/**
  * Get the query params for collections
  *
  * @return array
  */
 public function get_collection_params()
 {
     $params = parent::get_collection_params();
     $new_params = array();
     $new_params['context'] = $params['context'];
     $new_params['context']['default'] = 'edit';
     return $new_params;
 }
 /**
  * Retrieves the revision's schema, conforming to JSON Schema.
  *
  * @since 4.7.0
  * @access public
  *
  * @return array Item schema data.
  */
 public function get_item_schema()
 {
     $schema = array('$schema' => 'http://json-schema.org/schema#', 'title' => "{$this->parent_post_type}-revision", 'type' => 'object', 'properties' => array('author' => array('description' => __('The ID for the author of the object.'), 'type' => 'integer', 'context' => array('view', 'edit', 'embed')), 'date' => array('description' => __('The date the object was published.'), 'type' => 'string', 'format' => 'date-time', 'context' => array('view', 'edit', 'embed')), 'date_gmt' => array('description' => __('The date the object was published, as GMT.'), 'type' => 'string', 'format' => 'date-time', 'context' => array('view', 'edit')), 'guid' => array('description' => __('GUID for the object, as it exists in the database.'), 'type' => 'string', 'context' => array('view', 'edit')), 'id' => array('description' => __('Unique identifier for the object.'), 'type' => 'integer', 'context' => array('view', 'edit', 'embed')), 'modified' => array('description' => __('The date the object was last modified.'), 'type' => 'string', 'format' => 'date-time', 'context' => array('view', 'edit')), 'modified_gmt' => array('description' => __('The date the object was last modified, as GMT.'), 'type' => 'string', 'format' => 'date-time', 'context' => array('view', 'edit')), 'parent' => array('description' => __('The ID for the parent of the object.'), 'type' => 'integer', 'context' => array('view', 'edit', 'embed')), 'slug' => array('description' => __('An alphanumeric identifier for the object unique to its type.'), 'type' => 'string', 'context' => array('view', 'edit', 'embed'))));
     $parent_schema = $this->parent_controller->get_item_schema();
     if (!empty($parent_schema['properties']['title'])) {
         $schema['properties']['title'] = $parent_schema['properties']['title'];
     }
     if (!empty($parent_schema['properties']['content'])) {
         $schema['properties']['content'] = $parent_schema['properties']['content'];
     }
     if (!empty($parent_schema['properties']['excerpt'])) {
         $schema['properties']['excerpt'] = $parent_schema['properties']['excerpt'];
     }
     if (!empty($parent_schema['properties']['guid'])) {
         $schema['properties']['guid'] = $parent_schema['properties']['guid'];
     }
     return $this->add_additional_fields_schema($schema);
 }
 /**
  * Get the query params for collections of plugins.
  *
  * @since 0.1.0
  *
  * @return array
  */
 public function get_collection_params()
 {
     $params = parent::get_collection_params();
     $params['context']['default'] = 'view';
     $params['exclude'] = array('description' => __('Ensure result set excludes specific IDs.', 'buddypress'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $params['include'] = array('description' => __('Ensure result set includes specific IDs.', 'buddypress'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $params['order'] = array('description' => __('Order sort attribute ascending or descending.', 'buddypress'), 'type' => 'string', 'default' => 'desc', 'enum' => array('asc', 'desc'), 'validate_callback' => 'rest_validate_request_arg');
     $params['after'] = array('description' => __('Limit result set to items published after a given ISO8601 compliant date.', 'buddypress'), 'type' => 'string', 'format' => 'date-time', 'validate_callback' => 'rest_validate_request_arg');
     $params['per_page'] = array('description' => __('Maximum number of results returned per result set.', 'buddypress'), 'default' => 20, 'type' => 'integer', 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg');
     $params['page'] = array('description' => __('Offset the result set by a specific number of pages of results.', 'buddypress'), 'default' => 1, 'type' => 'integer', 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg');
     $params['author'] = array('description' => __('Limit result set to items created by specific authors.', 'buddypress'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list', 'validate_callback' => 'rest_validate_request_arg');
     $params['status'] = array('default' => 'published', 'description' => __('Limit result set to items with a specific status.', 'buddypress'), 'type' => 'string', 'enum' => array('published', 'spam'), 'sanitize_callback' => 'sanitize_key', 'validate_callback' => 'rest_validate_request_arg');
     $params['primary_id'] = array('description' => __('Limit result set to items with a specific prime assocation.', 'buddypress'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $params['secondary_id'] = array('description' => __('Limit result set to items with a specific secondary assocation.', 'buddypress'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $params['component'] = array('description' => __('Limit result set to items with a specific BuddyPress component.', 'buddypress'), 'type' => 'string', 'enum' => array_keys(bp_core_get_components()), 'sanitize_callback' => 'sanitize_key', 'validate_callback' => 'rest_validate_request_arg');
     $params['type'] = array('description' => __('Limit result set to items with a specific activity type.', 'buddypress'), 'type' => 'string', 'enum' => array_keys(bp_activity_get_types()), 'sanitize_callback' => 'sanitize_key', 'validate_callback' => 'rest_validate_request_arg');
     $params['search'] = array('description' => __('Limit result set to items that match this search query.', 'buddypress'), 'default' => '', 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'validate_callback' => 'rest_validate_request_arg');
     return $params;
 }
 /**
  * Get the query params for collections
  *
  * @return array
  */
 public function get_collection_params()
 {
     $query_params = parent::get_collection_params();
     $query_params['order'] = array('description' => 'Order sort attribute ascending or descending.', 'type' => 'string', 'default' => 'asc', 'enum' => array('asc', 'desc'));
     $query_params['orderby'] = array('description' => 'Sort collection by object attribute.', 'type' => 'string', 'default' => 'name', 'enum' => array('id', 'name', 'slug'));
     $taxonomy = get_taxonomy($this->taxonomy);
     if ($taxonomy->hierarchical) {
         $query_params['parent'] = array('description' => 'Limit result set to terms assigned to a specific parent term.', 'type' => 'integer', 'sanitize_callback' => 'absint');
     }
     return $query_params;
 }
 /**
  * Get the query params for collections
  *
  * @return array
  */
 public function get_collection_params()
 {
     $query_params = parent::get_collection_params();
     $query_params['context']['default'] = 'view';
     $query_params['author_email'] = array('default' => null, 'description' => __('Limit result set to that from a specific author email.'), 'format' => 'email', 'sanitize_callback' => 'sanitize_email', 'type' => 'string');
     $query_params['include'] = array('description' => __('Limit result set to specific ids.'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $query_params['karma'] = array('default' => null, 'description' => __('Limit result set to that of a particular comment karma.'), 'sanitize_callback' => 'absint', 'type' => 'integer');
     $query_params['order'] = array('description' => __('Order sort attribute ascending or descending.'), 'type' => 'string', 'sanitize_callback' => 'sanitize_key', 'default' => 'asc', 'enum' => array('asc', 'desc'));
     $query_params['orderby'] = array('description' => __('Sort collection by object attribute.'), 'type' => 'string', 'sanitize_callback' => 'sanitize_key', 'default' => 'date_gmt');
     $query_params['parent'] = array('default' => null, 'description' => __('Limit result set to that of a specific comment parent id.'), 'sanitize_callback' => 'absint', 'type' => 'integer');
     $query_params['post'] = array('default' => null, 'description' => __('Limit result set to comments assigned to a specific post id.'), 'sanitize_callback' => 'absint', 'type' => 'integer');
     $query_params['post_author'] = array('default' => null, 'description' => __('Limit result set to comments associated with posts of a specific post author id.'), 'sanitize_callback' => 'absint', 'type' => 'integer');
     $query_params['post_slug'] = array('default' => null, 'description' => __('Limit result set to comments associated with posts of a specific post slug.'), 'sanitize_callback' => 'sanitize_title', 'type' => 'string');
     $query_params['post_parent'] = array('default' => null, 'description' => __('Limit result set to comments associated with posts of a specific post parent id.'), 'sanitize_callback' => 'absint', 'type' => 'integer');
     $query_params['post_status'] = array('default' => null, 'description' => __('Limit result set to comments associated with posts of a specific post status.'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string');
     $query_params['post_type'] = array('default' => null, 'description' => __('Limit result set to comments associated with posts of a specific post type.'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string');
     $query_params['status'] = array('default' => 'approve', 'description' => __('Limit result set to comments assigned a specific status.'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string');
     $query_params['type'] = array('default' => 'comment', 'description' => __('Limit result set to comments assigned a specific type.'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string');
     $query_params['user'] = array('default' => null, 'description' => __('Limit result set to comments assigned to a specific user id.'), 'sanitize_callback' => 'absint', 'type' => 'integer');
     return $query_params;
 }
 /**
  * Retrieves the query params for collections.
  *
  * @since 4.7.0
  * @access public
  *
  * @return array Collection parameters.
  */
 public function get_collection_params()
 {
     $query_params = parent::get_collection_params();
     $query_params['context']['default'] = 'view';
     $query_params['exclude'] = array('description' => __('Ensure result set excludes specific ids.'), 'type' => 'array', 'items' => array('type' => 'integer'), 'default' => array());
     $query_params['include'] = array('description' => __('Limit result set to specific ids.'), 'type' => 'array', 'items' => array('type' => 'integer'), 'default' => array());
     $query_params['offset'] = array('description' => __('Offset the result set by a specific number of items.'), 'type' => 'integer');
     $query_params['order'] = array('default' => 'asc', 'description' => __('Order sort attribute ascending or descending.'), 'enum' => array('asc', 'desc'), 'type' => 'string');
     $query_params['orderby'] = array('default' => 'name', 'description' => __('Sort collection by object attribute.'), 'enum' => array('id', 'include', 'name', 'registered_date', 'slug', 'email', 'url'), 'type' => 'string');
     $query_params['slug'] = array('description' => __('Limit result set to resources with a specific slug.'), 'type' => 'string');
     $query_params['roles'] = array('description' => __('Limit result set to resources matching at least one specific role provided. Accepts csv list or single role.'), 'type' => 'array', 'items' => array('type' => 'string'));
     return $query_params;
 }
 /**
  * @return array
  */
 public function get_public_item_schema()
 {
     return parent::get_public_item_schema();
     // TODO: Change the autogenerated stub
 }
 /**
  * Get the query params for collections.
  *
  * @since 8.5.26
  *
  * @return array
  */
 public function get_collection_params()
 {
     $query_params = parent::get_collection_params();
     $query_params['context']['default'] = 'view';
     $params['slug'] = array('description' => __('Limit result set to entries with a specific slug.', 'connections'), 'type' => 'string', 'validate_callback' => 'rest_validate_request_arg');
     return $query_params;
 }
 /**
  * Get the query params for collections
  *
  * @return array
  */
 public function get_collection_params()
 {
     $query_params = parent::get_collection_params();
     $query_params['context'] = array('default' => 'view', 'description' => 'Change the response format based on request context.', 'enum' => array('embed', 'view', 'edit'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string');
     $query_params['order'] = array('default' => 'asc', 'description' => 'Order sort attribute ascending or descending.', 'enum' => array('asc', 'desc'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string');
     $query_params['orderby'] = array('default' => 'name', 'description' => 'Sort collection by object attribute.', 'enum' => array('id', 'name', 'registered_date'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string');
     return $query_params;
 }
 /**
  * Retrieves the query params for collections.
  *
  * @since 4.7.0
  * @access public
  *
  * @return array Collection parameters.
  */
 public function get_collection_params()
 {
     $query_params = parent::get_collection_params();
     $query_params['context']['default'] = 'view';
     $query_params['exclude'] = array('description' => __('Ensure result set excludes specific IDs.'), 'type' => 'array', 'items' => array('type' => 'integer'), 'default' => array());
     $query_params['include'] = array('description' => __('Limit result set to specific IDs.'), 'type' => 'array', 'items' => array('type' => 'integer'), 'default' => array());
     $query_params['offset'] = array('description' => __('Offset the result set by a specific number of items.'), 'type' => 'integer');
     $query_params['order'] = array('default' => 'asc', 'description' => __('Order sort attribute ascending or descending.'), 'enum' => array('asc', 'desc'), 'type' => 'string');
     $query_params['orderby'] = array('default' => 'name', 'description' => __('Sort collection by object attribute.'), 'enum' => array('id', 'include', 'name', 'registered_date', 'slug', 'email', 'url'), 'type' => 'string');
     $query_params['slug'] = array('description' => __('Limit result set to users with a specific slug.'), 'type' => 'string');
     $query_params['roles'] = array('description' => __('Limit result set to users matching at least one specific role provided. Accepts csv list or single role.'), 'type' => 'array', 'items' => array('type' => 'string'));
     /**
      * Filter collection parameters for the users controller.
      *
      * This filter registers the collection parameter, but does not map the
      * collection parameter to an internal WP_User_Query parameter.  Use the
      * `rest_user_query` filter to set WP_User_Query arguments.
      *
      * @since 4.7.0
      *
      * @param $params JSON Schema-formatted collection parameters.
      */
     return apply_filters('rest_user_collection_params', $query_params);
 }
 /**
  * Get the query params for collections.
  *
  * @return array
  */
 public function get_collection_params()
 {
     $params = parent::get_collection_params();
     $params['context']['default'] = 'view';
     $params['exclude'] = array('description' => __('Ensure result set excludes specific ids.', 'woocommerce'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $params['include'] = array('description' => __('Limit result set to specific ids.', 'woocommerce'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $params['offset'] = array('description' => __('Offset the result set by a specific number of items.', 'woocommerce'), 'type' => 'integer', 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg');
     $params['order'] = array('default' => 'asc', 'description' => __('Order sort attribute ascending or descending.', 'woocommerce'), 'enum' => array('asc', 'desc'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string', 'validate_callback' => 'rest_validate_request_arg');
     $params['orderby'] = array('default' => 'order', 'description' => __('Sort collection by object attribute.', 'woocommerce'), 'enum' => array('id', 'order'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string', 'validate_callback' => 'rest_validate_request_arg');
     $params['class'] = array('description' => __('Sort by tax class.', 'woocommerce'), 'enum' => array_merge(array('standard'), array_map('sanitize_title', WC_Tax::get_tax_classes())), 'sanitize_callback' => 'sanitize_title', 'type' => 'string', 'validate_callback' => 'rest_validate_request_arg');
     return $params;
 }
 /**
  * Get the query params for collections of attachments.
  *
  * @return array
  */
 public function get_collection_params()
 {
     $params = parent::get_collection_params();
     $params['context']['default'] = 'view';
     if (post_type_supports($this->post_type, 'author')) {
         $params['author'] = array('description' => __('Limit result set to posts assigned to specific authors.'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list', 'validate_callback' => 'rest_validate_request_arg');
         $params['author_exclude'] = array('description' => __('Ensure result set excludes posts assigned to specific authors.'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list', 'validate_callback' => 'rest_validate_request_arg');
     }
     $params['exclude'] = array('description' => __('Ensure result set excludes specific ids.'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $params['include'] = array('description' => __('Limit result set to specific ids.'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     if ('page' === $this->post_type || post_type_supports($this->post_type, 'page-attributes')) {
         $params['menu_order'] = array('description' => __('Limit result set to resources with a specific menu_order value.'), 'type' => 'integer', 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg');
     }
     $params['offset'] = array('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.'), 'type' => 'string', 'default' => 'date', 'enum' => array('date', 'id', 'include', 'title', 'slug'), 'validate_callback' => 'rest_validate_request_arg');
     if ('page' === $this->post_type || post_type_supports($this->post_type, 'page-attributes')) {
         $params['orderby']['enum'][] = 'menu_order';
     }
     $post_type_obj = get_post_type_object($this->post_type);
     if ($post_type_obj->hierarchical || 'attachment' === $this->post_type) {
         $params['parent'] = array('description' => _('Limit result set to those of particular parent ids.'), 'type' => 'array', 'sanitize_callback' => 'wp_parse_id_list', 'default' => array());
         $params['parent_exclude'] = array('description' => _('Limit result set to all items except those of a particular parent id.'), 'type' => 'array', 'sanitize_callback' => 'wp_parse_id_list', 'default' => array());
     }
     $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', 'description' => __('Limit result set to posts assigned a specific status.'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string', 'validate_callback' => array($this, 'validate_user_can_query_private_statuses'));
     $params['filter'] = array('description' => __('Use WP Query arguments to modify the response; private query vars require appropriate authorization.'));
     return $params;
 }
 /**
  * Retrieves the query params for collections.
  *
  * @since 4.7.0
  * @access public
  *
  * @return array Comments collection parameters.
  */
 public function get_collection_params()
 {
     $query_params = parent::get_collection_params();
     $query_params['context']['default'] = 'view';
     $query_params['after'] = array('description' => __('Limit response to resources published after a given ISO8601 compliant date.'), 'type' => 'string', 'format' => 'date-time');
     $query_params['author'] = array('description' => __('Limit result set to comments assigned to specific user ids. Requires authorization.'), 'type' => 'array', 'items' => array('type' => 'integer'));
     $query_params['author_exclude'] = array('description' => __('Ensure result set excludes comments assigned to specific user ids. Requires authorization.'), 'type' => 'array', 'items' => array('type' => 'integer'));
     $query_params['author_email'] = array('default' => null, 'description' => __('Limit result set to that from a specific author email. Requires authorization.'), 'format' => 'email', 'type' => 'string');
     $query_params['before'] = array('description' => __('Limit response to resources published before a given ISO8601 compliant date.'), 'type' => 'string', 'format' => 'date-time');
     $query_params['exclude'] = array('description' => __('Ensure result set excludes specific ids.'), 'type' => 'array', 'items' => array('type' => 'integer'), 'default' => array());
     $query_params['include'] = array('description' => __('Limit result set to specific ids.'), 'type' => 'array', 'items' => array('type' => 'integer'), 'default' => array());
     $query_params['karma'] = array('default' => null, 'description' => __('Limit result set to that of a particular comment karma. Requires authorization.'), 'type' => 'integer');
     $query_params['offset'] = array('description' => __('Offset the result set by a specific number of comments.'), 'type' => 'integer');
     $query_params['order'] = array('description' => __('Order sort attribute ascending or descending.'), 'type' => 'string', 'default' => 'desc', 'enum' => array('asc', 'desc'));
     $query_params['orderby'] = array('description' => __('Sort collection by object attribute.'), 'type' => 'string', 'default' => 'date_gmt', 'enum' => array('date', 'date_gmt', 'id', 'include', 'post', 'parent', 'type'));
     $query_params['parent'] = array('default' => array(), 'description' => __('Limit result set to resources of specific parent ids.'), 'type' => 'array', 'items' => array('type' => 'integer'));
     $query_params['parent_exclude'] = array('default' => array(), 'description' => __('Ensure result set excludes specific parent ids.'), 'type' => 'array', 'items' => array('type' => 'integer'));
     $query_params['post'] = array('default' => array(), 'description' => __('Limit result set to resources assigned to specific post ids.'), 'type' => 'array', 'items' => array('type' => 'integer'));
     $query_params['status'] = array('default' => 'approve', 'description' => __('Limit result set to comments assigned a specific status. Requires authorization.'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string', 'validate_callback' => 'rest_validate_request_arg');
     $query_params['type'] = array('default' => 'comment', 'description' => __('Limit result set to comments assigned a specific type. Requires authorization.'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string', 'validate_callback' => 'rest_validate_request_arg');
     return $query_params;
 }
 /**
  * Get the query params for collections
  *
  * @return array
  */
 public function get_collection_params()
 {
     $query_params = parent::get_collection_params();
     $query_params['context']['default'] = 'view';
     $query_params['include'] = array('description' => __('Limit result set to specific ids.'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $query_params['order'] = array('default' => 'asc', 'description' => __('Order sort attribute ascending or descending.'), 'enum' => array('asc', 'desc'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string');
     $query_params['orderby'] = array('default' => 'name', 'description' => __('Sort collection by object attribute.'), 'enum' => array('id', 'include', 'name', 'registered_date'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string');
     return $query_params;
 }
 /**
  * Get the query params for collections
  *
  * @return array
  */
 public function get_collection_params()
 {
     $query_params = parent::get_collection_params();
     $query_params['context']['default'] = 'view';
     $query_params['exclude'] = array('description' => __('Ensure result set excludes specific ids.'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $query_params['include'] = array('description' => __('Limit result set to specific ids.'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $query_params['offset'] = array('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('default' => 'asc', 'description' => __('Order sort attribute ascending or descending.'), 'enum' => array('asc', 'desc'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string', 'validate_callback' => 'rest_validate_request_arg');
     $query_params['orderby'] = array('default' => 'name', 'description' => __('Sort collection by object attribute.'), 'enum' => array('id', 'include', 'name', 'registered_date'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string', '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;
 }
 /**
  * Get the query params for collections of attachments.
  *
  * @return array
  */
 public function get_collection_params()
 {
     $params = parent::get_collection_params();
     $params['context']['default'] = 'view';
     if (post_type_supports($this->post_type, 'author')) {
         $params['author'] = array('description' => __('Limit result set to posts assigned to a specific author.'), 'type' => 'integer', 'default' => null, 'sanitize_callback' => 'absint');
     }
     $params['include'] = array('description' => __('Limit result set to specific ids.'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $params['order'] = array('description' => __('Order sort attribute ascending or descending.'), 'type' => 'string', 'default' => 'desc', 'enum' => array('asc', 'desc'));
     $params['orderby'] = array('description' => __('Sort collection by object attribute.'), 'type' => 'string', 'default' => 'date', 'enum' => array('date', 'id', 'include', 'title', 'slug'));
     $post_type_obj = get_post_type_object($this->post_type);
     if ($post_type_obj->hierarchical) {
         $params['parent'] = array('description' => _('Limit result set to that of a specific parent id.'), 'type' => 'integer', 'sanitize_callback' => 'absint', 'default' => null);
     }
     $params['status'] = array('default' => 'attachment' === $this->post_type ? 'inherit' : 'publish', 'description' => __('Limit result set to posts assigned a specific status.'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string', 'validate_callback' => array($this, 'validate_user_can_query_private_statuses'));
     $params['filter'] = array('description' => __('Use WP Query arguments to modify the response; private query vars require appropriate authorization.'));
     return $params;
 }
 /**
  * Get the query params for collections of attachments.
  *
  * @return array
  */
 public function get_collection_params()
 {
     $params = parent::get_collection_params();
     $params['context']['default'] = 'view';
     if (post_type_supports($this->post_type, 'author')) {
         $params['author'] = array('description' => 'Limit result set to posts assigned to a specific author.', 'type' => 'integer', 'default' => null, 'sanitize_callback' => 'absint');
     }
     $params['order'] = array('description' => 'Order sort attribute ascending or descending.', 'type' => 'string', 'default' => 'asc', 'enum' => array('asc', 'desc'));
     $params['orderby'] = array('description' => 'Sort collection by object attribute.', 'type' => 'string', 'default' => 'name', 'enum' => array('id', 'title', 'slug'));
     $params['status'] = array('default' => 'publish', 'description' => 'Limit result set to posts assigned a specific status.', 'sanitize_callback' => 'sanitize_key', 'type' => 'string', 'validate_callback' => array($this, 'validate_user_can_query_private_statuses'));
     $params['filter'] = array();
     return $params;
 }
 public function get_collection_params()
 {
     $params = parent::get_collection_params();
     $params['offset'] = array('description' => __('Offset the result set by a specific number of items.'), 'type' => 'integer', 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg');
     return $params;
 }
 /**
  * Get the query params for collections of attachments.
  *
  * @return array
  */
 public function get_collection_params()
 {
     $params = parent::get_collection_params();
     $params['context']['default'] = 'view';
     $params['sidebar'] = array('description' => __('Limit result set to widgets assigned to this sidebar.'), 'type' => 'string', 'default' => null, 'sanitize_callback' => 'sanitize_key');
     return $params;
 }
 /**
  * Get the query params for collections
  *
  * @since 8.5.26
  *
  * @return array
  */
 public function get_collection_params()
 {
     $query_params = parent::get_collection_params();
     //$taxonomy = get_taxonomy( $this->taxonomy );
     $query_params['context']['default'] = 'view';
     $query_params['exclude'] = array('description' => __('Ensure result set excludes specific ids.', 'connections'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $query_params['include'] = array('description' => __('Limit result set to specific ids.', 'connections'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $query_params['offset'] = array('description' => __('Offset the result set by a specific number of items.', 'connections'), 'type' => 'integer', 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg');
     $query_params['order'] = array('description' => __('Order sort attribute ascending or descending.', 'connections'), 'type' => 'string', 'sanitize_callback' => 'sanitize_key', 'default' => 'asc', 'enum' => array('asc', 'desc'), 'validate_callback' => 'rest_validate_request_arg');
     $query_params['orderby'] = array('description' => __('Sort collection by resource attribute.', 'connections'), 'type' => 'string', 'sanitize_callback' => 'sanitize_key', 'default' => 'name', 'enum' => array('id', 'include', 'name', 'slug', 'term_group', 'description', 'count'), 'validate_callback' => 'rest_validate_request_arg');
     $query_params['hide_empty'] = array('description' => __('Whether to hide resources not assigned to any posts.', 'connections'), 'type' => 'boolean', 'default' => FALSE, 'validate_callback' => 'rest_validate_request_arg');
     $query_params['parent'] = array('description' => __('Limit result set to resources assigned to a specific parent.', 'connections'), '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.', 'connections'), 'type' => 'integer', 'default' => NULL, 'validate_callback' => 'rest_validate_request_arg');
     $query_params['slug'] = array('description' => __('Limit result set to resources with a specific slug.', 'connections'), 'type' => 'string', 'validate_callback' => 'rest_validate_request_arg');
     return $query_params;
 }
 /**
  * Get the query params for collections of attachments.
  *
  * @return array
  */
 public function get_collection_params()
 {
     $params = parent::get_collection_params();
     $params['context']['default'] = 'view';
     $params['after'] = array('description' => __('Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce'), 'type' => 'string', 'format' => 'date-time', 'validate_callback' => 'rest_validate_request_arg');
     $params['before'] = array('description' => __('Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce'), 'type' => 'string', 'format' => 'date-time', 'validate_callback' => 'rest_validate_request_arg');
     $params['exclude'] = array('description' => __('Ensure result set excludes specific ids.', 'woocommerce'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $params['include'] = array('description' => __('Limit result set to specific ids.', 'woocommerce'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $params['offset'] = array('description' => __('Offset the result set by a specific number of items.', 'woocommerce'), 'type' => 'integer', 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg');
     $params['order'] = array('description' => __('Order sort attribute ascending or descending.', 'woocommerce'), 'type' => 'string', 'default' => 'desc', 'enum' => array('asc', 'desc'), 'validate_callback' => 'rest_validate_request_arg');
     $params['orderby'] = array('description' => __('Sort collection by object attribute.', 'woocommerce'), 'type' => 'string', 'default' => 'date', 'enum' => array('date', 'id', 'include', 'title', 'slug'), 'validate_callback' => 'rest_validate_request_arg');
     $post_type_obj = get_post_type_object($this->post_type);
     if ($post_type_obj->hierarchical) {
         $params['parent'] = array('description' => __('Limit result set to those of particular parent ids.', 'woocommerce'), 'type' => 'array', 'sanitize_callback' => 'wp_parse_id_list', 'default' => array());
         $params['parent_exclude'] = array('description' => __('Limit result set to all items except those of a particular parent id.', 'woocommerce'), 'type' => 'array', 'sanitize_callback' => 'wp_parse_id_list', 'default' => array());
     }
     $params['slug'] = array('description' => __('Limit result set to posts with a specific slug.', 'woocommerce', 'woocommerce'), 'type' => 'string', 'validate_callback' => 'rest_validate_request_arg');
     $params['filter'] = array('description' => __('Use WP Query arguments to modify the response; private query vars require appropriate authorization.', 'woocommerce'));
     return $params;
 }
 /**
  * Get the query params for collections
  *
  * @return array
  */
 public function get_collection_params()
 {
     $params = parent::get_collection_params();
     if ('' !== $this->taxonomy) {
         $taxonomy = get_taxonomy($this->taxonomy);
     } else {
         $taxonomy = new stdClass();
         $taxonomy->hierarchical = true;
     }
     $params['context']['default'] = 'view';
     $params['exclude'] = array('description' => __('Ensure result set excludes specific ids.', 'woocommerce'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $params['include'] = array('description' => __('Limit result set to specific ids.', 'woocommerce'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     if (!$taxonomy->hierarchical) {
         $params['offset'] = array('description' => __('Offset the result set by a specific number of items.', 'woocommerce'), 'type' => 'integer', 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg');
     }
     $params['order'] = array('description' => __('Order sort attribute ascending or descending.', 'woocommerce'), 'type' => 'string', 'sanitize_callback' => 'sanitize_key', 'default' => 'asc', 'enum' => array('asc', 'desc'), 'validate_callback' => 'rest_validate_request_arg');
     $params['orderby'] = array('description' => __('Sort collection by resource attribute.', 'woocommerce'), 'type' => 'string', 'sanitize_callback' => 'sanitize_key', 'default' => 'name', 'enum' => array('id', 'include', 'name', 'slug', 'term_group', 'description', 'count'), 'validate_callback' => 'rest_validate_request_arg');
     $params['hide_empty'] = array('description' => __('Whether to hide resources not assigned to any products.', 'woocommerce'), 'type' => 'boolean', 'default' => false, 'validate_callback' => 'rest_validate_request_arg');
     if ($taxonomy->hierarchical) {
         $params['parent'] = array('description' => __('Limit result set to resources assigned to a specific parent.', 'woocommerce'), 'type' => 'integer', 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg');
     }
     $params['product'] = array('description' => __('Limit result set to resources assigned to a specific product.', 'woocommerce'), 'type' => 'integer', 'default' => null, 'validate_callback' => 'rest_validate_request_arg');
     $params['slug'] = array('description' => __('Limit result set to resources with a specific slug.', 'woocommerce'), 'type' => 'string', 'validate_callback' => 'rest_validate_request_arg');
     return $params;
 }
 /**
  * Retrieves the query params for the posts collection.
  *
  * @since 4.7.0
  * @access public
  *
  * @return array Collection parameters.
  */
 public function get_collection_params()
 {
     $query_params = parent::get_collection_params();
     $query_params['context']['default'] = 'view';
     $query_params['after'] = array('description' => __('Limit response to posts published after a given ISO8601 compliant date.'), 'type' => 'string', 'format' => 'date-time');
     if (post_type_supports($this->post_type, 'author')) {
         $query_params['author'] = array('description' => __('Limit result set to posts assigned to specific authors.'), 'type' => 'array', 'items' => array('type' => 'integer'), 'default' => array());
         $query_params['author_exclude'] = array('description' => __('Ensure result set excludes posts assigned to specific authors.'), 'type' => 'array', 'items' => array('type' => 'integer'), 'default' => array());
     }
     $query_params['before'] = array('description' => __('Limit response to posts published before a given ISO8601 compliant date.'), 'type' => 'string', 'format' => 'date-time');
     $query_params['exclude'] = array('description' => __('Ensure result set excludes specific IDs.'), 'type' => 'array', 'items' => array('type' => 'integer'), 'default' => array());
     $query_params['include'] = array('description' => __('Limit result set to specific IDs.'), 'type' => 'array', 'items' => array('type' => 'integer'), 'default' => array());
     if ('page' === $this->post_type || post_type_supports($this->post_type, 'page-attributes')) {
         $query_params['menu_order'] = array('description' => __('Limit result set to posts with a specific menu_order value.'), 'type' => 'integer');
     }
     $query_params['offset'] = array('description' => __('Offset the result set by a specific number of items.'), 'type' => 'integer');
     $query_params['order'] = array('description' => __('Order sort attribute ascending or descending.'), 'type' => 'string', 'default' => 'desc', 'enum' => array('asc', 'desc'));
     $query_params['orderby'] = array('description' => __('Sort collection by object attribute.'), 'type' => 'string', 'default' => 'date', 'enum' => array('date', 'relevance', 'id', 'include', 'title', 'slug'));
     if ('page' === $this->post_type || post_type_supports($this->post_type, 'page-attributes')) {
         $query_params['orderby']['enum'][] = 'menu_order';
     }
     $post_type = get_post_type_object($this->post_type);
     if ($post_type->hierarchical || 'attachment' === $this->post_type) {
         $query_params['parent'] = array('description' => __('Limit result set to those of particular parent IDs.'), 'type' => 'array', 'items' => array('type' => 'integer'), 'default' => array());
         $query_params['parent_exclude'] = array('description' => __('Limit result set to all items except those of a particular parent ID.'), 'type' => 'array', 'items' => array('type' => 'integer'), 'default' => array());
     }
     $query_params['slug'] = array('description' => __('Limit result set to posts with one or more specific slugs.'), 'type' => 'array', 'items' => array('type' => 'string'), 'sanitize_callback' => 'wp_parse_slug_list');
     $query_params['status'] = array('default' => 'publish', 'description' => __('Limit result set to posts assigned one or more statuses.'), 'type' => 'array', 'items' => array('enum' => array_merge(array_keys(get_post_stati()), array('any')), 'type' => 'string'), 'sanitize_callback' => array($this, 'sanitize_post_statuses'));
     $taxonomies = wp_list_filter(get_object_taxonomies($this->post_type, 'objects'), array('show_in_rest' => true));
     foreach ($taxonomies as $taxonomy) {
         $base = !empty($taxonomy->rest_base) ? $taxonomy->rest_base : $taxonomy->name;
         $query_params[$base] = array('description' => sprintf(__('Limit result set to all items that have the specified term assigned in the %s taxonomy.'), $base), 'type' => 'array', 'items' => array('type' => 'integer'), 'default' => array());
         $query_params[$base . '_exclude'] = array('description' => sprintf(__('Limit result set to all items except those that have the specified term assigned in the %s taxonomy.'), $base), 'type' => 'array', 'items' => array('type' => 'integer'), 'default' => array());
     }
     if ('post' === $this->post_type) {
         $query_params['sticky'] = array('description' => __('Limit result set to items that are sticky.'), 'type' => 'boolean');
     }
     /**
      * Filter collection parameters for the posts controller.
      *
      * The dynamic part of the filter `$this->post_type` refers to the post
      * type slug for the controller.
      *
      * This filter registers the collection parameter, but does not map the
      * collection parameter to an internal WP_Query parameter. Use the
      * `rest_{$this->post_type}_query` filter to set WP_Query parameters.
      *
      * @since 4.7.0
      *
      * @param array        $query_params JSON Schema-formatted collection parameters.
      * @param WP_Post_Type $post_type    Post type object.
      */
     return apply_filters("rest_{$this->post_type}_collection_params", $query_params, $post_type);
 }
 /**
  * Get the query params for collections of attachments.
  *
  * @return array
  */
 public function get_collection_params()
 {
     $params = parent::get_collection_params();
     $params['context']['default'] = 'view';
     $params['after'] = array('description' => __('Limit response to resources published after a given ISO8601 compliant date.'), 'type' => 'string', 'format' => 'date-time', 'validate_callback' => 'rest_validate_request_arg');
     if (post_type_supports($this->post_type, 'author')) {
         $params['author'] = array('description' => __('Limit result set to posts assigned to specific authors.'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list', 'validate_callback' => 'rest_validate_request_arg');
         $params['author_exclude'] = array('description' => __('Ensure result set excludes posts assigned to specific authors.'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list', 'validate_callback' => 'rest_validate_request_arg');
     }
     $params['before'] = array('description' => __('Limit response to resources published before a given ISO8601 compliant date.'), 'type' => 'string', 'format' => 'date-time', 'validate_callback' => 'rest_validate_request_arg');
     $params['exclude'] = array('description' => __('Ensure result set excludes specific ids.'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $params['include'] = array('description' => __('Limit result set to specific ids.'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     if ('page' === $this->post_type || post_type_supports($this->post_type, 'page-attributes')) {
         $params['menu_order'] = array('description' => __('Limit result set to resources with a specific menu_order value.'), 'type' => 'integer', 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg');
     }
     $params['offset'] = array('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.'), 'type' => 'string', 'default' => 'date', 'enum' => array('date', 'id', 'include', 'title', 'slug'), 'validate_callback' => 'rest_validate_request_arg');
     if ('page' === $this->post_type || post_type_supports($this->post_type, 'page-attributes')) {
         $params['orderby']['enum'][] = 'menu_order';
     }
     $post_type_obj = get_post_type_object($this->post_type);
     if ($post_type_obj->hierarchical || 'attachment' === $this->post_type) {
         $params['parent'] = array('description' => __('Limit result set to those of particular parent ids.'), 'type' => 'array', 'sanitize_callback' => 'wp_parse_id_list', 'default' => array());
         $params['parent_exclude'] = array('description' => __('Limit result set to all items except those of a particular parent id.'), 'type' => 'array', 'sanitize_callback' => 'wp_parse_id_list', 'default' => array());
     }
     $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', 'description' => __('Limit result set to posts assigned a specific status.'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string', 'validate_callback' => array($this, 'validate_user_can_query_private_statuses'));
     $params['filter'] = array('description' => __('Use WP Query arguments to modify the response; private query vars require appropriate authorization.'));
     $taxonomies = wp_list_filter(get_object_taxonomies($this->post_type, 'objects'), array('show_in_rest' => true));
     foreach ($taxonomies as $taxonomy) {
         $base = !empty($taxonomy->rest_base) ? $taxonomy->rest_base : $taxonomy->name;
         $params[$base] = array('description' => sprintf(__('Limit result set to all items that have the specified term assigned in the %s taxonomy.'), $base), 'type' => 'array', 'sanitize_callback' => 'wp_parse_id_list', 'default' => array());
     }
     return $params;
 }
 /**
  * Get the query params for collections
  *
  * @return array
  */
 public function get_collection_params()
 {
     $query_params = parent::get_collection_params();
     $query_params['context'] = array('description' => 'Change the response format based on request context.', 'default' => 'view', 'sanitize_callback' => 'sanitize_key', 'type' => 'string', 'enum' => array('embed', 'view'));
     $query_params['order'] = array('description' => 'Order sort attribute ascending or descending.', 'type' => 'string', 'sanitize_callback' => 'sanitize_key', 'default' => 'asc', 'enum' => array('asc', 'desc'));
     $query_params['orderby'] = array('description' => 'Sort collection by object attribute.', 'type' => 'string', 'sanitize_callback' => 'sanitize_key', 'default' => 'name', 'enum' => array('id', 'name', 'slug', 'term_group', 'term_id', 'description', 'count'));
     $query_params['per_page'] = array('description' => 'Number of terms to query at a time with pagination.', 'type' => 'integer', 'sanitize_callback' => 'absint', 'default' => 10);
     $query_params['page'] = array('description' => 'Number of the desired page within the paginated query results.', 'type' => 'integer', 'sanitize_callback' => 'absint', 'default' => 1);
     $query_params['hide_empty'] = array('description' => 'Whether to hide terms not assigned to any posts.', 'type' => 'boolean', 'default' => false);
     $query_params['search'] = array('description' => 'Search keyword.', 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field');
     $taxonomy = get_taxonomy($this->taxonomy);
     if ($taxonomy->hierarchical) {
         $query_params['parent'] = array('description' => 'Limit result set to terms assigned to a specific parent term.', 'type' => 'integer', 'sanitize_callback' => 'absint');
     }
     return $query_params;
 }
 /**
  * Retrieves the query params for collections.
  *
  * @since 4.7.0
  * @access public
  *
  * @return array Comments collection parameters.
  */
 public function get_collection_params()
 {
     $query_params = parent::get_collection_params();
     $query_params['context']['default'] = 'view';
     $query_params['after'] = array('description' => __('Limit response to comments published after a given ISO8601 compliant date.'), 'type' => 'string', 'format' => 'date-time');
     $query_params['author'] = array('description' => __('Limit result set to comments assigned to specific user IDs. Requires authorization.'), 'type' => 'array', 'items' => array('type' => 'integer'));
     $query_params['author_exclude'] = array('description' => __('Ensure result set excludes comments assigned to specific user IDs. Requires authorization.'), 'type' => 'array', 'items' => array('type' => 'integer'));
     $query_params['author_email'] = array('default' => null, 'description' => __('Limit result set to that from a specific author email. Requires authorization.'), 'format' => 'email', 'type' => 'string');
     $query_params['before'] = array('description' => __('Limit response to comments published before a given ISO8601 compliant date.'), 'type' => 'string', 'format' => 'date-time');
     $query_params['exclude'] = array('description' => __('Ensure result set excludes specific IDs.'), 'type' => 'array', 'items' => array('type' => 'integer'), 'default' => array());
     $query_params['include'] = array('description' => __('Limit result set to specific IDs.'), 'type' => 'array', 'items' => array('type' => 'integer'), 'default' => array());
     $query_params['offset'] = array('description' => __('Offset the result set by a specific number of items.'), 'type' => 'integer');
     $query_params['order'] = array('description' => __('Order sort attribute ascending or descending.'), 'type' => 'string', 'default' => 'desc', 'enum' => array('asc', 'desc'));
     $query_params['orderby'] = array('description' => __('Sort collection by object attribute.'), 'type' => 'string', 'default' => 'date_gmt', 'enum' => array('date', 'date_gmt', 'id', 'include', 'post', 'parent', 'type'));
     $query_params['parent'] = array('default' => array(), 'description' => __('Limit result set to comments of specific parent IDs.'), 'type' => 'array', 'items' => array('type' => 'integer'));
     $query_params['parent_exclude'] = array('default' => array(), 'description' => __('Ensure result set excludes specific parent IDs.'), 'type' => 'array', 'items' => array('type' => 'integer'));
     $query_params['post'] = array('default' => array(), 'description' => __('Limit result set to comments assigned to specific post IDs.'), 'type' => 'array', 'items' => array('type' => 'integer'));
     $query_params['status'] = array('default' => 'approve', 'description' => __('Limit result set to comments assigned a specific status. Requires authorization.'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string', 'validate_callback' => 'rest_validate_request_arg');
     $query_params['type'] = array('default' => 'comment', 'description' => __('Limit result set to comments assigned a specific type. Requires authorization.'), 'sanitize_callback' => 'sanitize_key', 'type' => 'string', 'validate_callback' => 'rest_validate_request_arg');
     $query_params['password'] = array('description' => __('The password for the post if it is password protected.'), 'type' => 'string');
     /**
      * Filter collection parameters for the comments controller.
      *
      * This filter registers the collection parameter, but does not map the
      * collection parameter to an internal WP_Comment_Query parameter. Use the
      * `rest_comment_query` filter to set WP_Comment_Query parameters.
      *
      * @since 4.7.0
      *
      * @param $params JSON Schema-formatted collection parameters.
      */
     return apply_filters('rest_comment_collection_params', $query_params);
 }
 /**
  * Get the query params for collections
  *
  * @return array
  */
 public function get_collection_params()
 {
     $query_params = parent::get_collection_params();
     $query_params['context']['default'] = 'view';
     $query_params['author_email'] = array('default' => null, 'description' => 'Limit result set to that from a specific author email.', 'format' => 'email', 'sanitize_callback' => 'sanitize_email', 'type' => 'string');
     $query_params['karma'] = array('default' => null, 'description' => 'Limit result set to that of a particular comment karma.', 'sanitize_callback' => 'absint', 'type' => 'integer');
     $query_params['parent'] = array('default' => null, 'description' => 'Limit result set to that of a specific comment parent id.', 'sanitize_callback' => 'absint', 'type' => 'integer');
     $query_params['post'] = array('default' => null, 'description' => 'Limit result set to comments assigned to a specific post id.', 'sanitize_callback' => 'absint', 'type' => 'integer');
     $query_params['post_author'] = array('default' => null, 'description' => 'Limit result set to comments associated with posts of a specific post author id.', 'sanitize_callback' => 'absint', 'type' => 'integer');
     $query_params['post_slug'] = array('default' => null, 'description' => 'Limit result set to comments associated with posts of a specific post slug.', 'sanitize_callback' => 'sanitize_title', 'type' => 'string');
     $query_params['post_parent'] = array('default' => null, 'description' => 'Limit result set to comments associated with posts of a specific post parent id.', 'sanitize_callback' => 'absint', 'type' => 'integer');
     $query_params['post_status'] = array('default' => null, 'description' => 'Limit result set to comments associated with posts of a specific post status.', 'sanitize_callback' => 'sanitize_key', 'type' => 'string');
     $query_params['post_type'] = array('default' => null, 'description' => 'Limit result set to comments associated with posts of a specific post type.', 'sanitize_callback' => 'sanitize_key', 'type' => 'string');
     $query_params['status'] = array('default' => 'approve', 'description' => 'Limit result set to comments assigned a specific status.', 'sanitize_callback' => 'sanitize_key', 'type' => 'string');
     $query_params['type'] = array('default' => 'comment', 'description' => 'Limit result set to comments assigned a specific type.', 'sanitize_callback' => 'sanitize_key', 'type' => 'string');
     $query_params['user'] = array('default' => null, 'description' => 'Limit result set to comments assigned to a specific user id.', 'sanitize_callback' => 'absint', 'type' => 'integer');
     return $query_params;
 }
 /**
  * Retrieves the query params for collections.
  *
  * @since 4.7.0
  * @access public
  *
  * @return array Collection parameters.
  */
 public function get_collection_params()
 {
     $query_params = parent::get_collection_params();
     $taxonomy = get_taxonomy($this->taxonomy);
     $query_params['context']['default'] = 'view';
     $query_params['exclude'] = array('description' => __('Ensure result set excludes specific IDs.'), 'type' => 'array', 'items' => array('type' => 'integer'), 'default' => array());
     $query_params['include'] = array('description' => __('Limit result set to specific IDs.'), 'type' => 'array', 'items' => array('type' => 'integer'), 'default' => array());
     if (!$taxonomy->hierarchical) {
         $query_params['offset'] = array('description' => __('Offset the result set by a specific number of items.'), 'type' => 'integer');
     }
     $query_params['order'] = array('description' => __('Order sort attribute ascending or descending.'), 'type' => 'string', 'default' => 'asc', 'enum' => array('asc', 'desc'));
     $query_params['orderby'] = array('description' => __('Sort collection by term attribute.'), 'type' => 'string', 'default' => 'name', 'enum' => array('id', 'include', 'name', 'slug', 'term_group', 'description', 'count'));
     $query_params['hide_empty'] = array('description' => __('Whether to hide terms not assigned to any posts.'), 'type' => 'boolean', 'default' => false);
     if ($taxonomy->hierarchical) {
         $query_params['parent'] = array('description' => __('Limit result set to terms assigned to a specific parent.'), 'type' => 'integer');
     }
     $query_params['post'] = array('description' => __('Limit result set to terms assigned to a specific post.'), 'type' => 'integer', 'default' => null);
     $query_params['slug'] = array('description' => __('Limit result set to terms with a specific slug.'), 'type' => 'string');
     /**
      * Filter collection parameters for the terms controller.
      *
      * The dynamic part of the filter `$this->taxonomy` refers to the taxonomy
      * slug for the controller.
      *
      * This filter registers the collection parameter, but does not map the
      * collection parameter to an internal WP_Term_Query parameter.  Use the
      * `rest_{$this->taxonomy}_query` filter to set WP_Term_Query parameters.
      *
      * @since 4.7.0
      *
      * @param array       $query_params JSON Schema-formatted collection parameters.
      * @param WP_Taxonomy $taxonomy     Taxonomy object.
      */
     return apply_filters("rest_{$this->taxonomy}_collection_params", $query_params, $taxonomy);
 }
 /**
  * Get the query params for collections
  *
  * @return array
  */
 public function get_collection_params()
 {
     $query_params = parent::get_collection_params();
     $taxonomy = get_taxonomy($this->taxonomy);
     $query_params['context']['default'] = 'view';
     $query_params['exclude'] = array('description' => __('Ensure result set excludes specific ids.'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     $query_params['include'] = array('description' => __('Limit result set to specific ids.'), 'type' => 'array', 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list');
     if (!$taxonomy->hierarchical) {
         $query_params['offset'] = array('description' => __('Offset the result set by a specific number of items.'), 'type' => 'integer', 'sanitize_callback' => 'absint');
     }
     $query_params['order'] = array('description' => __('Order sort attribute ascending or descending.'), 'type' => 'string', 'sanitize_callback' => 'sanitize_key', 'default' => 'asc', 'enum' => array('asc', 'desc'));
     $query_params['orderby'] = array('description' => __('Sort collection by object attribute.'), 'type' => 'string', 'sanitize_callback' => 'sanitize_key', 'default' => 'name', 'enum' => array('id', 'include', 'name', 'slug', 'term_group', 'description', 'count'));
     $query_params['hide_empty'] = array('description' => __('Whether to hide terms not assigned to any posts.'), 'type' => 'boolean', 'default' => false);
     if ($taxonomy->hierarchical) {
         $query_params['parent'] = array('description' => __('Limit result set to terms assigned to a specific parent term.'), 'type' => 'integer', 'sanitize_callback' => 'absint');
     }
     $query_params['post'] = array('description' => __('Limit result set to terms assigned to a specific post.'), 'type' => 'number', 'default' => false);
     $query_params['slug'] = array('description' => __('Limit result set to terms with a specific slug.'), 'type' => 'string');
     return $query_params;
 }
 /**
  * Get the query params for collections of attachments.
  *
  * @return array
  */
 public function get_collection_params()
 {
     $params = parent::get_collection_params();
     $params['filter'] = array();
     return $params;
 }