wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php:27Core controller used to access attachments via the REST API.
Every hook that fires from inside WP_REST_Attachments_Controller, in the order it appears in the class, grouped by the method that fires it.
$allow_batchfalseprotectedclass WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { /** * Whether the controller supports batching. * * @since 5.9.0 * @var false */ protected $allow_batch = false; /** * Image size token for the source-format original preserved alongside a * client-generated derivative (e.g. the HEIC file kept next to its JPEG). * * Used both in the `/sideload` route schema and when dispatching the * sideloaded file to its metadata key, so the two never drift apart. * * @since 7.1.0 * @var string */ const IMAGE_SIZE_SOURCE_ORIGINAL = 'source_original'; /** * Metadata key holding the basename of the source-format original. * * Deliberately specific so it never collides with the generic `original` * or `original_image` keys other flows write to. * * @since 7.1.0 * @var string */ const META_KEY_SOURCE_IMAGE = 'source_image'; /** * Post meta key recording the file names produced by the sideload endpoint. * * Each successful sideload appends the file name(s) it created for an * attachment under this key. The finalize endpoint reads them back to * confirm every stored sub-size was actually produced here, rather than * trusting a client-supplied name that could point at another attachment's * files. Stored as one row per value (via {@see add_post_meta()}) so concurrent * sideloads never read-modify-write a shared value. * * @since 7.1.0 * @var string */ const META_KEY_SIDELOAD_FILE_NAME = '_wp_sideloaded_file'; /** * Registers the routes for attachments. * * @since 5.3.0 * * @see register_rest_route() */ 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 attachment.' ), 'type' => 'integer', ), 'action' => array( 'type' => 'string', 'enum' => array( 'create-image-subsizes' ), 'required' => true, ), ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\d]+)/edit',Introduced in 4.7.0. 17 changes between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
get_endpoint_args_for_item_schema() added.verified against sourcecreate_item_from_url() added.verified against sourceremove_client_side_media_processing_filters() added.verified against sourcesideload_item_permissions_check() added.verified against sourcevalidate_image_size_names() added.verified against sourceget_special_image_sizes() added.verified against sourcevalidate_image_dimensions() added.verified against sourcedimension_exceeds_max() added.verified against sourcesideload_item() added.verified against sourcefilter_wp_unique_filename() added.verified against sourcevalidate_sub_size_provenance() added.verified against sourceget_sideloaded_file_names() added.verified against sourceget_attachment_upload_subdir() added.verified against sourcefinalize_item() added.verified against sourceget_attachment_filename() added.verified against sourceget_attachment_filesize() added.verified against sourceprepare_links() added.verified against sourcesrc/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.