Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

img_caption_shortcode()

3 tags 1 category

img_caption_shortcode() — 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’.

Inputs: $attr (array): Attributes of the caption shortcode. Field $id (string): ID of the image and caption container element, i.e. <figure> or <div>. Field $caption_id (string): ID of the caption element, i.e. <figcaption> or <p>. Field $align (string): Class name that aligns the caption. Default ‘alignnone’. Accepts ‘alignleft’, ‘aligncenter’, alignright’, ‘alignnone’. Field $width (int): The width of the caption, in pixels. Field $caption (string): The caption text. Field $class (string): Additional class name(s) added to the caption container. $content (string): Optional. Shortcode content. Default empty string.

Returns string: HTML content to display the caption.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…