Server : Apache System : Linux cs317.bluehost.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : andertr9 ( 1047) PHP Version : 8.2.18 Disable Function : NONE Directory : /home1/andertr9/public_html/wp-content/themes/ssp-starter/includes/shortcodes/ |
Upload File : |
<?php if ( ! function_exists( 'ssp_starter_shortcode_video' )) { function ssp_starter_shortcode_video( $atts , $content = null ) { extract( shortcode_atts( array( 'src' => '' , 'aspect' => '16:9' , 'height' => 270 , 'width' => 480 , 'title' => '' , 'type' => '' , 'animation' => '' , ) , $atts )); $video = ''; if ( $src ) { $video .= ( $animation ) ? '<div class="wpb_animate_when_almost_visible wpb_' . $animation . ' wpb_start_animation">' : ''; $video .= $title ? '<h4 class="video-title">' . $title . '</h4>' : ''; $aspect = str_replace( '.' , '' , $aspect ); $aspect = str_replace( ':' , '' , $aspect ); $class = 'video aspect-ratio-' . $aspect; $class .= ( $type == 'background' ) ? ' bgvideo' : ''; $property = $type == 'background' ? "{ containment : 'self' , showControls : false , videoURL : '" . $src . "' }" : ''; $video .= '<div class="' . $class . '"'; $video .= $property ? ' data-property="' . $property . '"' : ''; $video .= '>'; $video .= $type != 'background' ? '<iframe src="' . $src . '" width="' . $width . '" height="' . $height . '" ></iframe>' : ''; $video .= '</div>'; $video .= ( $animation ) ? '</div>' : ''; } return $video; } } add_shortcode( 'video', 'ssp_starter_shortcode_video' );