You are here

function bs_shortcodes_carousel_item in Bootstrap 3 shortcodes 7

bs_shortcodes_carousel_item

@author Filip Stefansson @since 1.0

File

./bs_shortcodes.module, line 1426

Code

function bs_shortcodes_carousel_item($attrs, $content = '') {
  if (!isset($GLOBALS['carousel_count'])) {
    $GLOBALS['carousel_count'] = 0;
  }
  extract(shortcode_attrs(array(
    "active" => '',
    "caption" => '',
    "xclass" => '',
    "data" => '',
  ), $attrs));
  $class = 'item';
  $class .= $active != '' ? ' active' : '';
  $class .= $xclass ? ' ' . $xclass : '';
  $data_props = _bs_shortcodes_parse_data_attributes($data);
  $content = preg_replace('/class=".*?"/', '', $content);
  return sprintf('<div class="%s"%s>%s%s</div>', check_plain($class), $data_props ? ' ' . $data_props : '', $content, $caption ? '<div class="carousel-caption">' . check_markup($caption) . '</div>' : '');
}