img_caption_shortcode_width хук-фильтр . WP 3.7.0
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.
Использование
add_filter( 'img_caption_shortcode_width', 'filter_function_name_3118', 10, 3 ); function filter_function_name_3118( $width, $atts, $content ){ // filter... return $width; }
- $width(число)
- Width of the caption in pixels. To remove this inline style, return zero.
- $atts(массив)
- Attributes of the caption shortcode.
- $content(строка)
- The image element, possibly wrapped in a hyperlink.
Список изменений
С версии 3.7.0 | Введена. |
Где вызывается хук
img_caption_shortcode_width
wp-includes/media.php 2104
$caption_width = apply_filters( 'img_caption_shortcode_width', $width, $atts, $content );