Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <figure id="attachment_123" class="panel wp-caption alignleft">
- <div class="panel-body">
- <a class="caption-link" href="http://localhost/alpha/wp-content/uploads/ORIGINAL-IMAGE.jpg" data-toggle="lightbox" data-title="Caption Text">
- <img class="alignleft size-tiny wp-image-123" src="http://localhost/alpha/wp-content/uploads/TINY.jpg" alt="" width="200" height="200" />
- </a>
- </div>
- <figcaption class="panel-footer caption wp-caption-text">Caption Text</figcaption>
- </figure>
- <figure id="attachment_123" class="panel wp-caption alignleft">
- <div class="panel-body">
- <a class="caption-link" href="http://localhost/alpha/wp-content/uploads/LARGE-IMAGE.jpg" data-toggle="lightbox" data-title="Caption Text">
- <img class="alignleft size-tiny wp-image-123" src="http://localhost/alpha/wp-content/uploads/TINY.jpg" alt="" width="200" height="200" />
- </a>
- </div>
- <figcaption class="panel-footer caption wp-caption-text">Caption Text</figcaption>
- </figure>
- function img_caption_shortcode( $attr, $content = null ) {
- // New-style shortcode with the caption inside the shortcode with the link and image tags.
- if ( ! isset( $attr['caption'] ) ) {
- if ( preg_match( '#((?:<a [^>]+>s*)?<img [^>]+>(?:s*</a>)?)(.*)#is', $content, $matches ) ) {
- $content = $matches[1];
- $attr['caption'] = trim( $matches[2] );
- }
- } elseif ( strpos( $attr['caption'], '<' ) !== false ) {
- $attr['caption'] = wp_kses( $attr['caption'], 'post' );
- }
Add Comment
Please, Sign In to add comment