img_caption_shortcode


img_caption_shortcode ( $attr, $content = '' )

Parameters:
  • (array) attr { Attributes of the caption shortcode. @type string $id ID of the image and caption container element, i.e. `<figure>` or `<div>`. @type string $caption_id ID of the caption element, i.e. `<figcaption>` or `<p>`. @type string $align Class name that aligns the caption. Default 'alignnone'. Accepts 'alignleft', 'aligncenter', alignright', 'alignnone'. @type int $width The width of the caption, in pixels. @type string $caption The caption text. @type string $class Additional class name(s) added to the caption container. }
  • (string) content Optional. Shortcode content. Default empty string.
Returns:
  • (string) HTML content to display the caption.
Defined at:
Change Log:
  • 3: .
  • 5: .
  • 5: .

Description

Builds the Caption shortcode output.Allows a plugin to replace the content that would otherwise be returned. The filter is {@see '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'.

Related Functions

do_shortcode, wp_audio_shortcode, wp_video_shortcode, add_shortcode, apply_shortcodes

Top Google Results

User discussions

wpseek mobile