/** * Get the query params for collections of attachments. * * @return array */ public function get_collection_params() { $params = parent::get_collection_params(); $params['author']['sanitize_callback'] = array($this, 'parse_author_list'); $params['author_exclude']['sanitize_callback'] = array($this, 'parse_author_list'); return $params; }
/** * Retrieves the query params for collections of attachments. * * @since 4.7.0 * @access public * * @return array Query parameters for the attachment collection as an array. */ public function get_collection_params() { $params = parent::get_collection_params(); $params['status']['default'] = 'inherit'; $params['status']['items']['enum'] = array('inherit', 'private', 'trash'); $media_types = $this->get_media_types(); $params['media_type'] = array('default' => null, 'description' => __('Limit result set to attachments of a particular media type.'), 'type' => 'string', 'enum' => array_keys($media_types)); $params['mime_type'] = array('default' => null, 'description' => __('Limit result set to attachments of a particular MIME type.'), 'type' => 'string'); return $params; }
/** * Get the query params for collections of attachments. * * @return array */ public function get_collection_params() { $params = parent::get_collection_params(); $params['parent'] = array('description' => 'Limit results to attachments from a specified parent.', 'type' => 'integer', 'default' => null, 'sanitize_callback' => 'absint'); return $params; }
/** * Get the query params for collections of attachments. * * @return array */ public function get_collection_params() { $params = parent::get_collection_params(); $params['status']['default'] = 'inherit'; $params['status']['enum'] = array('inherit', 'private', 'trash'); return $params; }