WordPress at a glance
function is not described

wp_ajax_get_attachment() WP 3.5.0

Ajax handler for getting an attachment.

No Hooks.

Return

Nothing (null).

Usage

wp_ajax_get_attachment();

Code of wp ajax get attachment: wp-admin/includes/ajax-actions.php WP 5.2.1

<?php
function wp_ajax_get_attachment() {
	if ( ! isset( $_REQUEST['id'] ) ) {
		wp_send_json_error();
	}

	if ( ! $id = absint( $_REQUEST['id'] ) ) {
		wp_send_json_error();
	}

	if ( ! $post = get_post( $id ) ) {
		wp_send_json_error();
	}

	if ( 'attachment' != $post->post_type ) {
		wp_send_json_error();
	}

	if ( ! current_user_can( 'upload_files' ) ) {
		wp_send_json_error();
	}

	if ( ! $attachment = wp_prepare_attachment_for_js( $id ) ) {
		wp_send_json_error();
	}

	wp_send_json_success( $attachment );
}