Created
September 13, 2018 20:35
-
-
Save justinallen/c7296144ee990865f9c7b2f4fddbcc1a to your computer and use it in GitHub Desktop.
simple boilerplate wordpress shortcode
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
/** | |
* Boilerplate WordPress shortcode - can drop into functions.php | |
* Use: [bananify this="thing to add a banana to"] | |
*/ | |
function bananify_func( $atts ) { | |
$a = shortcode_atts( array( | |
'this' => 'something' | |
), $atts ); | |
$str = "<h1>"; | |
$str .= $a['this']; | |
$str .= " banana"; | |
$str .= "</h1>"; | |
return $str; | |
} | |
add_shortcode( 'bananify', 'bananify_func' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment