Filter hook 'image_add_caption_text'

in WP Core File wp-admin/includes/media.php at line 204

Description

Filters the caption text. Note: If the caption text is empty, the caption shortcode will not be appended to the image HTML when inserted into the editor. Passing an empty value also prevents the {@see 'image_add_caption_shortcode'} Filters from being evaluated at the end of image_add_caption().

Occurrences

Filename Line Number
wp-admin/includes/media.php 204

Parameters

Type Name Description
string $caption The original caption text.
int $id The attachment ID.

PHP Doc

/**
	 * Filters the caption text.
	 *
	 * Note: If the caption text is empty, the caption shortcode will not be appended
	 * to the image HTML when inserted into the editor.
	 *
	 * Passing an empty value also prevents the {@see 'image_add_caption_shortcode'}
	 * Filters from being evaluated at the end of image_add_caption().
	 *
	 * @since 4.1.0
	 *
	 * @param string $caption The original caption text.
	 * @param int    $id      The attachment ID.
	 */