WP_REST_Attachments_Controller::get_collection_params

Advertisement

Summery Summery

Retrieves the query params for collections of attachments.

Syntax Syntax

WP_REST_Attachments_Controller::get_collection_params()

Return Return

(array) Query parameters for the attachment collection as an array.

Source Source

File: wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php

					'description' => __( 'Description for the object, as it exists in the database.' ),
					'type'        => 'string',
					'context'     => array( 'edit' ),
				),
				'rendered' => array(
					'description' => __( 'HTML description for the object, transformed for display.' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
			),
		);

		$schema['properties']['media_type'] = array(
			'description' => __( 'Attachment type.' ),
			'type'        => 'string',
			'enum'        => array( 'image', 'file' ),
			'context'     => array( 'view', 'edit', 'embed' ),
			'readonly'    => true,
		);

Advertisement

Changelog Changelog

Changelog
Version Description
4.7.0 Introduced.

Advertisement

Leave a Reply