WP_REST_Attachments_Controller::register_routes

Advertisement

Summery Summery

Registers the routes for attachments.

Syntax Syntax

WP_REST_Attachments_Controller::register_routes()

Source Source

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

	public function register_routes() {
		parent::register_routes();
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/(?P<id>[\d]+)/post-process',
			array(
				'methods'             => WP_REST_Server::CREATABLE,
				'callback'            => array( $this, 'post_process_item' ),
				'permission_callback' => array( $this, 'post_process_item_permissions_check' ),
				'args'                => array(
					'id'     => array(
						'description' => __( 'Unique identifier for the object.' ),
						'type'        => 'integer',
					),
					'action' => array(
						'type'     => 'string',
						'enum'     => array( 'create-image-subsizes' ),
						'required' => true,
					),
				),
			)
		);
		register_rest_route(

Advertisement

Changelog Changelog

Changelog
Version Description
5.3.0 Introduced.

See also See also

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.