Last active
          August 29, 2015 14:17 
        
      - 
      
 - 
        
Save jdhobbsuk/badec38aec74476e7425 to your computer and use it in GitHub Desktop.  
    blockquote-shortcode.php
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // Blockquote | |
| // ------------------------------------------------------------- | |
| function my_shortcode_blockquote( $atts, $content ) { | |
| // extract and set defaults | |
| extract( shortcode_atts( array( | |
| 'line1' => '', | |
| 'line2' => '' | |
| ), $atts ) ); | |
| $output_string = '<blockquote>'; | |
| $output_string .= $content; | |
| $output_string .= '<cite>'; | |
| if($line1 != ''): | |
| $output_string .= '<strong>'.$line1.'</strong>'; | |
| endif; | |
| if($line2 != ''): | |
| $output_string .= '<em>'.$line2.'</em>'; | |
| endif; | |
| $output_string .= '</cite>'; | |
| $output_string .= '</blockquote>'; | |
| return force_balance_tags($output_string); | |
| } | |
| add_shortcode( 'blockquote', 'my_shortcode_blockquote' ); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment