$max_width, ) ); } if ( ! empty( $css ) AND function_exists( 'vc_shortcode_custom_css_class' ) ) { $classes .= ' ' . vc_shortcode_custom_css_class( $css ); } $classes .= ( ! empty( $el_class ) ) ? ( ' ' . $el_class ) : ''; $el_id = ( ! empty( $el_id ) ) ? ( ' id="' . esc_attr( $el_id ) . '"' ) : ''; foreach ( us_config( 'embeds' ) as $provider => $embed ) { if ( $embed['type'] != 'video' OR ! preg_match( $embed['regex'], $link, $matches ) ) { continue; } if ( $hide_controls AND $provider == 'youtube' ) { $video_title = '?controls=0'; } elseif ( $hide_video_title AND $provider == 'vimeo' ) { $video_title = '&byline=0&title=0'; } $video_id = $matches[ $embed['match_index'] ]; $embed_html = str_replace( '', $video_id, $embed['html'] ); $embed_html = str_replace( '', $video_title, $embed_html ); break; } if ( empty( $embed_html ) ) { // Using the default WordPress way global $wp_embed; $embed_html = $wp_embed->run_shortcode( '[embed]' . $link . '[/embed]' ); } $output = '
' . $embed_html . '
'; echo $output;