On this page
apply_filters( 'img_caption_shortcode_width', int $width, array $atts, string $content )
Filters the width of an image’s caption.
Description
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.
See also
Parameters
$widthint-
Width of the caption in pixels. To remove this inline style, return zero.
$attsarray-
Attributes of the caption shortcode.
$contentstring-
The image element, possibly wrapped in a hyperlink.
Source
File: wp-includes/media.php. View all references
$caption_width = apply_filters( 'img_caption_shortcode_width', $width, $atts, $content );
Related
Used By
| Used By | Description |
|---|---|
| img_caption_shortcode() wp-includes/media.php | Builds the Caption shortcode output. |
Changelog
| Version | Description |
|---|---|
| 3.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/img_caption_shortcode_width