WP Snippets: add shortcode with params


Into functions.php:

add_shortcode('ShortCode','shortGo');
function shortGo($atts = array(), $content = null, $tag){
    //set defaults
    shortcode_atts(array(
        'var1' => 'default var1',
        'var2' => false
    ), $atts);

    //do the rest
}