Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
simple boilerplate wordpress shortcode
/**
* 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
You can’t perform that action at this time.