WordPress at Your Fingertips
filter is not described

image_add_caption_text filter-hook . WP 4.1.0

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 image_add_caption_shortcode Filters from being evaluated at the end of image_add_caption().


add_filter( 'image_add_caption_text', 'filter_function_name_7961', 10, 2 );
function filter_function_name_7961( $caption, $id ){
	// filter...

	return $caption;
The original caption text.
The attachment ID.


Since 4.1.0 Introduced.

Where the hook is called

wp-admin/includes/media.php 204
$caption = apply_filters( 'image_add_caption_text', $caption, $id );

Where in WP core the hook is used WordPress

Usage not found.