如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款
img_caption_shortcode( array $attr, string $content = null )
Builds the Caption shortcode output.
描述
Allows a plugin to replace the content that would otherwise be returned. The filter is ‘img_caption_shortcode’ and passes an empty string, the attr parameter and the content parameter values.
The supported attributes for the shortcode are ‘id’, ‘caption_id’, ‘align’, ‘width’, ‘caption’, and ‘class’.
参数
- $attr
(array)
(Required)
Attributes of the caption shortcode.
- 'id'
(string) ID of the image and caption container element, i.e. <figure> or <div>. - 'caption_id'
(string) ID of the caption element, i.e. <figcaption> or <p>. - 'align'
(string) Class name that aligns the caption. Default 'alignnone'. Accepts 'alignleft', 'aligncenter', alignright', 'alignnone'. - 'width'
(int) The width of the caption, in pixels. - 'caption'
(string) The caption text. - 'class'
(string) Additional class name(s) added to the caption container.
- $content
(string)
(Optional)
Shortcode content.
Default value: null
返回
(string) HTML content to display the caption.