| 1 |
<?php |
| 2 |
|
| 3 |
function osc_theme_btngrp($params, $content = null) { |
| 4 |
extract(shortcode_atts(array( |
| 5 |
'style' => '', |
| 6 |
'class' => '' |
| 7 |
), $params)); |
| 8 |
$content = str_replace("]<br />", ']', $content); |
| 9 |
$content = str_replace("]<br />\n", ']', $content); |
| 10 |
$content = str_replace("<br />\n[", '[', $content); |
| 11 |
if ($style =='vertical') { |
| 12 |
$out = '<div class="btn-group-vertical ' . $class . '">' . do_shortcode($content) . '</div>'; |
| 13 |
} elseif ($style =='justified') { |
| 14 |
$out = '<div class="btn-group btn-group-justified ' . $class . '">' . do_shortcode($content) . '</div>'; |
| 15 |
}else{ |
| 16 |
$out = '<div class="btn-group ' . $class . '">' . do_shortcode($content) . '</div>'; |
| 17 |
} |
| 18 |
|
| 19 |
|
| 20 |
return $out; |
| 21 |
} |
| 22 |
|
| 23 |
add_shortcode('buttongroup', 'osc_theme_btngrp'); |
| 24 |
|
| 25 |
?> |