apply_filters( 'img_caption_shortcode_width', int $width, array $atts, string $content )

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.

Top ↑

See also

Top ↑


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

Top ↑


File: wp-includes/media.php. View all references

$caption_width = apply_filters( 'img_caption_shortcode_width', $width, $atts, $content );

Top ↑


Version Description
3.7.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.