Ah I got it. Is there a shorter version than this:
function ball_callback($atts,$content,$tag){
//collect values, combining passed in values and defaults
$values = shortcode_atts(array(
'num' => 'other'
),$atts);
//based on input determine what to return
$output = '';
if($values['num'] == '1'){
$output = 'output for 1';
}
else if($values['num'] == '2'){
$output = 'output for 2';
}
else if($values['num'] == '3'){
$output = 'output for 3';
}
else{
$output = ' ';
}
return $output;
}
add_shortcode('ball','ball_callback');
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.