'',
'align' => 'alignnone',
'width' => '',
'caption' => ''
);
/* Allow developers to override the default arguments. */
$defaults = apply_filters( 'hoot_cleaner_caption_defaults', $defaults );
/* Apply filters to the arguments. */
$attr = apply_filters( 'hoot_cleaner_caption_args', $attr );
/* Merge the defaults with user input. */
$attr = shortcode_atts( $defaults, $attr, 'caption' );
/* If the width is less than 1 or there is no caption, return the content wrapped between the [caption] tags. */
if ( 1 > $attr['width'] || empty( $attr['caption'] ) )
return $content;
/* Set up the attributes for the caption
. */
$attributes = !empty( $attr['id'] ) ? ' id="' . esc_attr( $attr['id'] ) . '"' : '';
$attributes .= ' class="wp-caption ' . esc_attr( $attr['align'] ) . '"';
/* Caption width filter hook from WP core. */
$caption_width = apply_filters( 'img_caption_shortcode_width', $attr['width'], $attr, $content );
/* If there's a width, add the inline style for it. */
if ( 0 < $caption_width )
$attributes .= ' style="max-width: ' . esc_attr( $caption_width ) . 'px"';
/* Open the caption
. */
$output = '';
/* Allow shortcodes for the content the caption was created for. */
$output .= do_shortcode( $content );
/* Append the caption text. */
$output .= '' . $attr['caption'] . '';
/* Close the caption