Skip to content

Instantly share code, notes, and snippets.

@danphilibin
Created February 20, 2012 00:50
Show Gist options
  • Save danphilibin/1866851 to your computer and use it in GitHub Desktop.
Save danphilibin/1866851 to your computer and use it in GitHub Desktop.
WordPress button shortcode
<?php
function button_shortcode($atts, $content = null) {
extract(shortcode_atts(array('link' => '#'), $atts));
return '<p class="clearfix"><a class="button" href="'.$link.'">' . do_shortcode($content) . '</a></p>';
}
add_shortcode('button', 'button_shortcode');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment