Filter hook 'img_caption_shortcode_width'

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

Description

Filters the width of an image's caption. By default, the caption is 10 pixels greater than the width of the image, to prevent post content from running up against a floated image.

Occurrences

Filename Line Number
wp-includes/media.php 2461

Parameters

Type Name Description
int $width Width of the caption in pixels. To remove this inline style, return zero.
array $atts Attributes of the caption shortcode.
string $content The image element, possibly wrapped in a hyperlink.

PHP Doc

/**
	 * Filters the width of an image's caption.
	 *
	 * By default, the caption is 10 pixels greater than the width of the image,
	 * to prevent post content from running up against a floated image.
	 *
	 * @since 3.7.0
	 *
	 * @see img_caption_shortcode()
	 *
	 * @param int    $width    Width of the caption in pixels. To remove this inline style,
	 *                         return zero.
	 * @param array  $atts     Attributes of the caption shortcode.
	 * @param string $content  The image element, possibly wrapped in a hyperlink.
	 */