Created
March 31, 2014 19:14
-
-
Save Manoz/9899929 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
/* Remove an old shortcode. | |
* Code by @boiteaweb | |
*/ | |
/* | |
* Exemple: | |
* [button color="babyblue" link="http://manoz.fr/facebook-template/2012-Facebook-template.zip" target="_blank"]Télécharger le template[/button] | |
*/ | |
add_shortcode( 'button', 'sc_button' ); | |
function sc_button( $atts=null, $content=null ) { | |
extract( shortcode_atts( array( // defaults | |
'link' => '#', | |
'color' => 'blue', | |
'target' => '_blank', | |
), $atts ) ); | |
return sprintf( '<a href="%s" class="%s" target="%">%s</a>', $link, $color, $target, $content ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment