Fires after a single attachment is created or updated via the REST API.
$attachmentWP_Post$requestWP_REST_Request$creatingboolwp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php:918WP_REST_Attachments_Controller::insert_attachment() * @since 4.7.0 * * @param WP_Post $attachment Inserted or updated attachment object. * @param WP_REST_Request $request The request sent to the API. * @param bool $creating True when creating an attachment, false when updating. */ do_action( 'rest_insert_attachment', $attachment, $request, true ); return array( 'attachment_id' => $id, 'file' => $file, ); }Introduced in 4.7.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.