wp_caption_input_textarea

Output a textarea element for inputting an attachment caption.

Description

(string) wp_caption_input_textarea( (WP_Post) $edit_post ); 

Returns (string)

HTML markup for the textarea element.

Parameters (1)

0. $edit_post (WP_Post)
Attachment WP_Post object.

Usage

  1. if ( !function_exists( 'wp_caption_input_textarea' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/media.php'; 
  3.  
  4. // Attachment WP_Post object. 
  5. $edit_post = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_caption_input_textarea($edit_post); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/media.php  
  1. function wp_caption_input_textarea($edit_post) { 
  2. // Post data is already escaped. 
  3. $name = "attachments[{$edit_post->ID}][post_excerpt]"; 
  4.  
  5. return '<textarea name="' . $name . '" id="' . $name . '">' . $edit_post->post_excerpt . '</textarea>';