You are here

function bs_shortcodes_button_group in Bootstrap 3 shortcodes 7

bs_shortcodes_button_group

@author M. W. Delaney

File

./bs_shortcodes.module, line 174

Code

function bs_shortcodes_button_group($attrs, $content = '') {
  extract(shortcode_attrs(array(
    "size" => '',
    "vertical" => '',
    "justified" => '',
    "dropup" => '',
    "xclass" => '',
    "data" => '',
  ), $attrs));
  $class = 'btn-group';
  $class .= $size ? ' btn-group-' . $size : '';
  $class .= $vertical != '' ? ' btn-group-vertical' : '';
  $class .= $justified != '' ? ' btn-group-justified' : '';
  $class .= $dropup != '' ? ' dropup' : '';
  $class .= $xclass ? ' ' . $xclass : '';
  $data_props = _bs_shortcodes_parse_data_attributes($data);
  return sprintf('<div class="%s"%s>%s</div>', check_plain($class), $data_props ? ' ' . $data_props : '', $content);
}