img_caption_shortcode_width
apply_filters( ‘img_caption_shortcode_width’, int $width , array $atts , string $content )
过滤钩子:过滤图片标题的宽度。
Filter Hook: Filters the width of an image’s caption.
说明(Description)
默认情况下,标题比图像的宽度大10像素,以防止文章内容在浮动图像上运行。
参数(Parameters)
参数 | 类型 | 说明 |
---|---|---|
$width | (int) | 标题的宽度(像素)。若要删除此内联样式,请返回零。 |
$atts | (array) | 标题快捷方式的属性。 |
$content | (string) | 图像元素,可能包装在超链接中。 |
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
3.7.0 | wp-includes/media.php:1784 | 1 | 0 |
笔记(Notes)
如果要删除额外的10像素宽度,请将以下内容添加到子主题的函数.php:
img_caption_shortcode_width 为WP2原创文章,链接:https://www.wp2.cn/hook/img_caption_shortcode_width/