Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //change image caption output html from <p> to <blockquote> //
- add_filter('img_caption_shortcode', 'img_caption_shortcode_blockquote', 10, 3);
- function img_caption_shortcode_blockquote($empty,$att = null,$cont= null) {
- extract(shortcode_atts(array(
- 'id' => '',
- 'align' => 'alignnone',
- 'width' => '',
- 'caption' => ''
- ), $att));
- if ( 1 > (int) $width || empty($caption) )
- return $cont;
- if ( $id ) $id = 'id="' . esc_attr($id) . '" ';
- return '<div ' . $id . 'class="wp-caption ' . esc_attr($align) . '" style="width: ' . (10 + (int) $width) . 'px">'
- . do_shortcode( $cont ) . '<blockquote class="wp-caption-text">' . $caption . '</blockquote></div>';
- }
Advertisement
Add Comment
Please, Sign In to add comment