fixed_img_caption_shortcode

The Evolved fixed img caption shortcode function.

Description

fixed_img_caption_shortcode( $attr, (constant) $content = null ); 

Parameters (2)

0. $attr
The attr.
1. $content — Optional. (constant) => null
The content.

Usage

  1. if ( !function_exists( 'fixed_img_caption_shortcode' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4. // The attr. 
  5. $attr = null; 
  6.  
  7. // The content. 
  8. $content = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = fixed_img_caption_shortcode($attr, $content); 
  12.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function fixed_img_caption_shortcode($attr, $content = null) { 
  2. // Allow plugins/themes to override the default caption template. 
  3. $output = apply_filters('img_caption_shortcode', '', $attr, $content); 
  4. if ( $output != '' ) return $output; 
  5. extract(shortcode_atts(array( 
  6. 'id'=> '',  
  7. 'align' => 'alignnone',  
  8. 'width' => '',  
  9. 'caption' => ''), $attr)); 
  10. if ( 1 > (int) $width || empty($caption) ) 
  11. return $content; 
  12. if ( $id ) $id = 'id="' . esc_attr($id) . '" '; 
  13. return '<div ' . $id . 'class="wp-caption ' . esc_attr($align) 
  14. . '" style="width:'.$width.'px;">' 
  15. . do_shortcode( $content ) . '<p class="wp-caption-text">' 
  16. . $caption . '</p></div>';