Skip to content

Instantly share code, notes, and snippets.

@marcjenkins
Last active August 29, 2015 13:56
Show Gist options
  • Save marcjenkins/8886206 to your computer and use it in GitHub Desktop.
Save marcjenkins/8886206 to your computer and use it in GitHub Desktop.
<?php
function shortcodeButton( $atts, $content = null ) {
extract( shortcode_atts( array(
'link' => 'contact/',
'colour' => 'green'
), $atts ) );
return '<a href="' . "{$link}" . '" class="btn btn-' . "{$colour}" . '">' . $content . ' </a>';
}
add_shortcode('button', 'shortcodeButton');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment