WP_REST_Attachments_Controller::get_collection_params()
Retrieves the query params for collections of attachments.
Метод класса: WP_REST_Attachments_Controller{}
Хуков нет.
Возвращает
Массив
. Query parameters for the attachment collection as an array.
Использование
$WP_REST_Attachments_Controller = new WP_REST_Attachments_Controller(); $WP_REST_Attachments_Controller->get_collection_params();
Список изменений
С версии 4.7.0 | Введена. |
Код WP_REST_Attachments_Controller::get_collection_params() WP REST Attachments Controller::get collection params WP 6.2.2
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; }