Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: YellowShark on Feb 13th, 2013  |  syntax: PHP  |  size: 0.46 KB  |  hits: 27  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3. // [h1]
  4. function h1($atts, $content = null) {
  5.         $defaults = array('align' => '', 'color' => '');
  6.         extract( shortcode_atts( $defaults, $atts ) );
  7.         $tag_class = '';
  8.         $tag_class .= !empty($align) ? " {$align}" : '';
  9.         $tag_class .= !empty($color) ? " {$color}" : '';
  10.  
  11.         ob_start(); ?> 
  12.                 <h1 class="<?php echo $tag_class;?>"><?php echo do_shortcode($content); ?></h1>
  13.         <?php $output = ob_get_clean();
  14.         return $output;
  15. }
  16. add_shortcode('h1', 'h1');
  17.  
  18. ?>