You are here

function bs_shortcodes_embed_responsive in Bootstrap 3 shortcodes 7

bs_embed_responsive

File

./bs_shortcodes.module, line 1735

Code

function bs_shortcodes_embed_responsive($attrs, $content = '') {
  extract(shortcode_attrs(array(
    "ratio" => '',
    "xclass" => '',
    "data" => '',
  ), $attrs));
  $class = 'embed-responsive ';
  $class .= $ratio ? ' embed-responsive-' . $ratio . ' ' : '';
  $class .= $xclass ? ' ' . $xclass : '';
  $embed_class = 'embed-responsive-item';
  $tag = array(
    'iframe',
    'embed',
    'video',
    'object',
  );
  $data_props = _bs_shortcodes_parse_data_attributes($data);
  return sprintf('<div class="%s"%s>%s</div>', check_plain($class), $data_props ? ' ' . $data_props : '', _bs_shortcodes_scrape_dom_element($tag, $content, $embed_class, '', ''));
}