if (!empty($arguments['caption'])) { $xmlCaption = Convert::raw2xml($arguments['caption']); $content .= "\n
"; } // Convert arguments to data-*argument_name* foreach ($arguments as $k => $v) { if($k === 'class' || $k === 'style') { continue; } unset($arguments[$k]); $arguments['data-'.$k] = $v; } $arguments['class'] .= ' embed-youtube embed-responsive embed-responsive-16by9'; $iframe = strpos($content, 'iframe'); if($iframe >= 0) { $content = substr($content, 0, $iframe+6).' class="embed-responsive-item" '.substr($content, $iframe +7); } return HTML::createTag('div', $arguments, $content); } }