You are here

function bs_shortcodes_code in Bootstrap 3 shortcodes 7

bs_shortcodes_code

@author Filip Stefansson @since 1.0

File

./bs_shortcodes.module, line 576

Code

function bs_shortcodes_code($attrs, $content = '') {
  extract(shortcode_attrs(array(
    "inline" => '',
    "scrollable" => '',
    "xclass" => '',
    "data" => '',
  ), $attrs));
  $class = '';
  $class .= $scrollable != '' ? ' pre-scrollable' : '';
  $class .= $xclass ? ' ' . $xclass : '';
  $data_props = _bs_shortcodes_parse_data_attributes($data);
  return sprintf('<%1$s class="%2$s"%3$s>%4$s</%1$s>', $inline ? 'code' : 'pre', check_plain($class), $data_props ? ' ' . $data_props : '', $content);
}