You are here

function bs_shortcodes_badge in Bootstrap 3 shortcodes 7

bs_shortcodes_badge

@author Filip Stefansson @since 1.0

File

./bs_shortcodes.module, line 895

Code

function bs_shortcodes_badge($attrs, $content = '') {
  extract(shortcode_attrs(array(
    "right" => '',
    "xclass" => '',
    "data" => '',
  ), $attrs));
  $class = 'badge';
  $class .= $right != '' ? ' pull-right' : '';
  $class .= $xclass ? ' ' . $xclass : '';
  $data_props = _bs_shortcodes_parse_data_attributes($data);
  return sprintf('<span class="%s"%s>%s</span>', check_plain($class), $data_props ? ' ' . $data_props : '', $content);
}