img_caption_shortcode ( $attr, $content = null )

  • (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 Shortcode content.
  • (string) HTML content to display the caption.
Defined at:
Change Log:
  • 3: .
  • 5: .


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

wp_video_shortcode, do_shortcode, wp_audio_shortcode, strip_shortcodes, remove_shortcode

Top Google Results

User discussions

wpseek mobile