wp_caption_input_textarea()WP 3.4.0

Outputs a textarea element for inputting an attachment caption.

No Hooks.

Return

String. HTML markup for the textarea element.

Usage

wp_caption_input_textarea( $edit_post );
$edit_post(WP_Post) (required)
Attachment WP_Post object.

Changelog

Since 3.4.0 Introduced.

wp_caption_input_textarea() code WP 6.5.2

function wp_caption_input_textarea( $edit_post ) {
	// Post data is already escaped.
	$name = "attachments[{$edit_post->ID}][post_excerpt]";

	return '<textarea name="' . $name . '" id="' . $name . '">' . $edit_post->post_excerpt . '</textarea>';
}