%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /dom645759/wp-content/plugins/fusion-builder/shortcodes/
Upload File :
Create Path :
Current File : //dom645759/wp-content/plugins/fusion-builder/shortcodes/fusion-youtube.php

<?php
/**
 * Add an element to fusion-builder.
 *
 * @package fusion-builder
 * @since 1.0
 */

if ( fusion_is_element_enabled( 'fusion_youtube' ) ) {

	if ( ! class_exists( 'FusionSC_Youtube' ) ) {
		/**
		 * Shortcode class.
		 *
		 * @since 1.0
		 */
		class FusionSC_Youtube extends Fusion_Element {

			/**
			 * The video counter.
			 *
			 * @access private
			 * @since 5.3
			 * @var int
			 */
			private $video_counter = 1;

			/**
			 * Constructor.
			 *
			 * @access public
			 * @since 1.0
			 */
			public function __construct() {
				parent::__construct();
				add_filter( 'fusion_attr_youtube-shortcode', [ $this, 'attr' ] );
				add_shortcode( 'fusion_youtube', [ $this, 'render' ] );
			}

			/**
			 * Gets the default values.
			 *
			 * @static
			 * @access public
			 * @since 2.0.0
			 * @return array
			 */
			public static function get_element_defaults() {
				$fusion_settings = awb_get_fusion_settings();

				return [
					'animation_type'             => '',
					'animation_direction'        => 'down',
					'animation_speed'            => '',
					'animation_delay'            => '',
					'animation_offset'           => $fusion_settings->get( 'animation_offset' ),
					'animation_color'            => '',
					'api_params'                 => '',
					'aspect_ratio'               => '',
					'autoplay'                   => 'false',
					'mute'                       => 'false',
					'preview_image'              => '',
					'preview_image_id'           => '',
					'alignment'                  => '',
					'border_color'               => '',
					'border_radius_top_left'     => '',
					'border_radius_top_right'    => '',
					'border_radius_bottom_right' => '',
					'border_radius_bottom_left'  => '',
					'border_size'                => '0',
					'border_style'               => 'solid',
					'box_shadow'                 => 'no',
					'box_shadow_blur'            => '',
					'box_shadow_color'           => '',
					'box_shadow_horizontal'      => '',
					'box_shadow_spread'          => '',
					'box_shadow_vertical'        => '',
					'controls'                   => '',
					'center'                     => 'no',
					'class'                      => '',
					'css_id'                     => '',
					'custom_aspect_ratio'        => '',
					'end_time'                   => '',
					'height'                     => 360,
					'loop'                       => 'false',
					'margin_top'                 => '',
					'margin_right'               => '',
					'margin_bottom'              => '',
					'margin_left'                => '',
					'hide_on_mobile'             => fusion_builder_default_visibility( 'string' ),
					'id'                         => '',
					'start_time'                 => '',
					'title_attribute'            => '',
					'thumbnail_size'             => 'auto',
					'width'                      => 600,
					'video_facade'               => $fusion_settings->get( 'video_facade' ),
					'video_facade_no_cookie'     => 'on',
					'structured_data'            => '',
					'video_title'                => '',
					'video_desc'                 => '',
					'video_duration'             => '',
					'video_upload_date'          => '',
					'video_upload_date_timezone' => '',
				];
			}

			/**
			 * Render the shortcode
			 *
			 * @access public
			 * @since 1.0
			 * @param  array  $args    Shortcode parameters.
			 * @param  string $content Content between shortcode.
			 * @return string          HTML output.
			 */
			public function render( $args, $content = '' ) {

				// Make videos 16:9 by default.
				if ( isset( $args['width'] ) && '' !== $args['width'] && ( ! isset( $args['height'] ) || '' === $args['height'] ) ) {
					$args['height'] = round( (float) $args['width'] * 9 / 16 );
				}

				if ( isset( $args['height'] ) && '' !== $args['height'] && ( ! isset( $args['width'] ) || '' === $args['width'] ) ) {
					$args['width'] = round( (float) $args['height'] * 16 / 9 );
				}

				$defaults = FusionBuilder::set_shortcode_defaults( self::get_element_defaults(), $args, 'fusion_youtube' );
				$content  = apply_filters( 'fusion_shortcode_content', $content, 'fusion_youtube', $args );

				$defaults['height'] = FusionBuilder::validate_shortcode_attr_value( $defaults['height'], '' );
				$defaults['width']  = FusionBuilder::validate_shortcode_attr_value( $defaults['width'], '' );

				// A set aspect ratio calculates the height from the width.
				$aspect_ratio = Fusion_Builder_Element_Helper::get_aspect_ratio_factor( $defaults['aspect_ratio'], $defaults['custom_aspect_ratio'] );
				if ( $aspect_ratio && 0 < (float) $defaults['width'] ) {
					$defaults['height'] = round( (float) $defaults['width'] * $aspect_ratio );
				}

				$this->args     = $defaults;
				$this->defaults = self::get_element_defaults();

				$this->args['margin_bottom'] = FusionBuilder::validate_shortcode_attr_value( $this->args['margin_bottom'], 'px' );
				$this->args['margin_top']    = FusionBuilder::validate_shortcode_attr_value( $this->args['margin_top'], 'px' );
				$this->args['margin_left']   = FusionBuilder::validate_shortcode_attr_value( $this->args['margin_left'], 'px' );
				$this->args['margin_right']  = FusionBuilder::validate_shortcode_attr_value( $this->args['margin_right'], 'px' );

				// Make sure only the video ID is passed to the iFrame.
				$pattern = '~(?:http|https|)(?::\/\/|)(?:www.|)(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[a-z0-9;:@#?&%=+\/\$_.-]*~i';
				$id      = $this->args['id'];
				preg_match( $pattern, $id, $matches );
				if ( isset( $matches[1] ) ) {
					$id = $matches[1];
				}

				// Structured Data attributes.
				$ds_attr = '';
				if ( 'on' === $this->args['structured_data'] ) {
					$ds_attr = ' itemscope itemtype="http://schema.org/VideoObject"';
				}

				$html = '<div ' . FusionBuilder::attributes( 'youtube-shortcode' ) . $ds_attr . '>';

				// Structured Data.
				if ( 'on' === $this->args['structured_data'] ) {
					$video_duration = '' !== $this->args['video_duration'] ? $this->get_duration( $this->args['video_duration'] ) : '';
					$html          .= $video_duration ? '<meta itemprop="duration" content="' . esc_attr( $video_duration ) . '" />' : '';

					$html .= '' !== $this->args['video_title'] ? '<meta itemprop="name" content="' . esc_attr( $this->args['video_title'] ) . '" />' : '';
					$html .= '' !== $this->args['video_desc'] ? '<meta itemprop="description" content="' . esc_attr( $this->args['video_desc'] ) . '" />' : '';
					if ( '' !== $this->args['video_upload_date'] ) {
						$this->args['video_upload_date'] = str_replace( ' ', 'T', $this->args['video_upload_date'] );
						$this->args['video_upload_date'] .= $this->args['video_upload_date_timezone'];

						$html .= '<meta itemprop="uploadDate" content="' . esc_attr( $this->args['video_upload_date'] ) . '" />';
					}
					$thumbnail_url = '' !== $this->args['preview_image'] ? esc_url_raw( $this->args['preview_image'] ) : 'https://i3.ytimg.com/vi/' . $id . '/hqdefault.jpg';
					$html         .= '<meta itemprop="thumbnailUrl" content="' . esc_attr( $thumbnail_url ) . '" />';
					$html         .= '<meta itemprop="embedUrl" content="https://www.youtube.com/embed/' . esc_attr( $id ) . '" />';
				}

				$html .= '<div class="video-shortcode">';
				$title = $this->args['title_attribute'] ? $this->args['title_attribute'] : 'YouTube video player ' . $this->video_counter;

				if ( 'true' === $this->args['mute'] || true === $this->args['mute'] || 'yes' === $this->args['mute'] ) {
					if ( false === strpos( $this->args['api_params'], 'mute=1' ) ) {
						$this->args['api_params'] .= '&mute=1';
					}
				}

				if ( 'true' === $this->args['loop'] ) {
					if ( false === strpos( $this->args['api_params'], 'loop=1' ) ) {
						$this->args['api_params'] .= '&loop=1&playlist=' . esc_attr( $id );
					}
				}

				if ( 'false' === $this->args['controls'] ) {
					if ( false === strpos( $this->args['api_params'], 'controls=0' ) ) {
						$this->args['api_params'] .= '&controls=0';
					}
				}

				if ( $this->args['start_time'] ) {
					if ( false === strpos( $this->args['api_params'], 'start=' ) ) {
						$this->args['api_params'] .= '&start=' . esc_attr( $this->args['start_time'] );
					}
				}

				if ( $this->args['end_time'] ) {
					if ( false === strpos( $this->args['api_params'], 'end=' ) ) {
						$this->args['api_params'] .= '&end=' . esc_attr( $this->args['end_time'] );
					}
				}

				if ( 'on' === $this->args['video_facade'] ) {
					$api_params = ( false === strpos( $this->args['api_params'], 'enablejsapi=1' ) ? $this->args['api_params'] . '&enablejsapi=1' : $this->args['api_params'] );
					$class      = ( $defaults['height'] > $defaults['width'] ) ? 'portrait' : 'landscape';
					$attrs      = Fusion_Builder_Element_Helper::get_video_facade_attrs( $class, $this->args['preview_image'], $this->args['preview_image_id'], 'yes' === $this->args['center'] ? '' : $this->args['width'] );
					$html      .= '<lite-youtube videoid="' . esc_attr( $id ) . '" ' . $attrs . ' params="wmode=transparent&autoplay=1' . esc_attr( $api_params ) . '" title="' . esc_attr( $title ) . '" data-button-label="' . esc_attr__( 'Play Video', 'fusion-builder' ) . '" width="' . esc_attr( $this->args['width'] ) . '" height="' . esc_attr( $this->args['height'] ) . '" data-thumbnail-size="' . esc_attr( $this->args['thumbnail_size'] ) . '" data-no-cookie="' . esc_attr( $this->args['video_facade_no_cookie'] ) . '"></lite-youtube>';
				} else {
					$iframe = '<iframe title="' . esc_attr( $title ) . '" src="https://www.youtube.com/embed/' . esc_attr( $id ) . '?wmode=transparent&autoplay=0' . esc_attr( $this->args['api_params'] ) . '" width="' . esc_attr( $this->args['width'] ) . '" height="' . esc_attr( $this->args['height'] ) . '" allowfullscreen allow="autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture;"></iframe>';

					if ( 0 < $defaults['height'] && 0 < $defaults['width'] ) {
						$iframe = '<div class="fluid-width-video-wrapper" style="padding-top:' . round( $defaults['height'] / $defaults['width'] * 100, 2 ) . '%;" >' . $iframe . '</div>';
					}

					$html .= $iframe;

					$html = fusion_library()->images->apply_global_selected_lazy_loading_to_iframe( $html );
				}

				$html .= '</div></div>';

				$this->on_render();

				$this->video_counter++;

				return apply_filters( 'fusion_element_youtube_content', $html, $args );
			}

			/**
			 * Parses the arguments.
			 *
			 * @access public
			 * @since 1.0
			 * @return array
			 */
			public function attr() {
				$attr = fusion_builder_visibility_atts(
					$this->args['hide_on_mobile'],
					[
						'class' => 'fusion-video fusion-youtube',
						'style' => $this->get_style_vars(),
					]
				);

				if ( 'yes' === $this->args['center'] ) {
					$attr['class'] .= ' center-video';
				}

				if ( '' !== $this->args['alignment'] && ! fusion_element_rendering_is_flex() ) {
					$attr['class'] .= ' fusion-align' . $this->args['alignment'];
				}

				if ( 'true' === $this->args['autoplay'] || true === $this->args['autoplay'] || 'yes' === $this->args['autoplay'] ) {
					$attr['data-autoplay'] = 1;
				}

				if ( $this->args['animation_type'] ) {
					$attr = Fusion_Builder_Animation_Helper::add_animation_attributes( $this->args, $attr );
				}

				if ( $this->args['class'] ) {
					$attr['class'] .= ' ' . $this->args['class'];
				}

				if ( $this->args['css_id'] ) {
					$attr['id'] = $this->args['css_id'];
				}

				return $attr;
			}

			/**
			 * Get style variables.
			 *
			 * @since 3.9
			 * @return string
			 */
			public function get_style_vars() {
				$custom_css_vars = [];

				if ( 'yes' !== $this->args['center'] ) {
					$custom_css_vars['max-width']  = $this->args['width'] . 'px';
					$custom_css_vars['max-height'] = $this->args['height'] . 'px';
				}

				if ( '' !== $this->args['alignment'] ) {
					if ( fusion_element_rendering_is_flex() ) {
						// RTL adjust.
						if ( is_rtl() && 'center' !== $this->args['alignment'] ) {
							$this->args['alignment'] = 'left' === $this->args['alignment'] ? 'right' : 'left';
						}

						if ( 'left' === $this->args['alignment'] ) {
							$custom_css_vars['align-self'] = 'flex-start';
						} elseif ( 'right' === $this->args['alignment'] ) {
							$custom_css_vars['align-self'] = 'flex-end';
						} else {
							$custom_css_vars['align-self'] = 'center';
						}
					}
					$custom_css_vars['width'] = '100%';
				}

				if ( 0 < (float) $this->args['border_size'] ) {
					$custom_css_vars['border-size']  = (float) $this->args['border_size'] . 'px';
					$custom_css_vars['border-style'] = in_array( $this->args['border_style'], [ 'dashed', 'dotted', 'double' ], true ) ? $this->args['border_style'] : 'solid';

					if ( '' !== $this->args['border_color'] ) {
						$custom_css_vars['border-color'] = Fusion_Sanitize::color( $this->args['border_color'] );
					}
				}

				// The video facade has a fixed ratio, a set aspect ratio overrides it.
				if ( Fusion_Builder_Element_Helper::get_aspect_ratio_factor( $this->args['aspect_ratio'], $this->args['custom_aspect_ratio'] ) && 0 < (float) $this->args['width'] ) {
					$custom_css_vars['aspect-ratio-padding'] = round( (float) $this->args['height'] / (float) $this->args['width'] * 100, 2 ) . '%';
				}

				$margin_style = Fusion_Builder_Margin_Helper::get_margin_vars(
					[
						'margin_top'    => $this->args['margin_top'],
						'margin_bottom' => $this->args['margin_bottom'],
					]
				);

				// Side margins are set directly, so the alignment margins only get replaced when set.
				foreach ( [ 'margin_left', 'margin_right' ] as $side ) {
					if ( '' !== $this->args[ $side ] ) {
						$margin_style .= str_replace( '_', '-', $side ) . ':' . fusion_library()->sanitize->get_value_with_unit( $this->args[ $side ] ) . ';';
					}
				}

				return $this->get_custom_css_vars( $custom_css_vars ) . Fusion_Builder_Border_Radius_Helper::get_border_radius_vars( $this->args ) . Fusion_Builder_Box_Shadow_Helper::get_box_shadow_css_var( '--awb-box-shadow', $this->args ) . $margin_style;
			}

			/**
			 * The video duration in ISO 8601 format.
			 *
			 * @access public
			 * @since 3.8
			 * @param  string $duration The video duration.
			 * @return string
			 */
			public function get_duration( $duration ) {
				$time     = 'PT';
				$duration = explode( ':', $duration );
				$hours    = '00' !== $duration[0] ? $duration[0] : '';
				$minutes  = '00' !== $duration[1] ? $duration[1] : '';
				$seconds  = '00' !== $duration[2] ? $duration[2] : '';

				$time .= $hours ? ltrim( $hours, '0' ) . 'H' : '';
				$time .= $minutes ? ltrim( $minutes, '0' ) . 'M' : '';
				$time .= $seconds ? ltrim( $seconds, '0' ) . 'S' : '';

				return $time;
			}

			/**
			 * Sets the necessary scripts.
			 *
			 * @access public
			 * @since 3.2
			 * @return void
			 */
			public function on_first_render() {
				Fusion_Dynamic_JS::enqueue_script( 'fusion-video' );
				Fusion_Dynamic_JS::enqueue_script( 'lite-youtube' );
			}

			/**
			 * Load base CSS.
			 *
			 * @access public
			 * @since 3.0
			 * @return void
			 */
			public function add_css_files() {
				FusionBuilder()->add_element_css( FUSION_BUILDER_PLUGIN_DIR . 'assets/css/shortcodes/youtube.min.css' );
				FusionBuilder()->add_element_css( FUSION_BUILDER_PLUGIN_DIR . 'assets/css/lite-yt-embed.min.css' );
			}
		}
	}

	new FusionSC_Youtube();

}

/**
 * Map shortcode to Avada Builder.
 *
 * @since 1.0
 */
function fusion_element_youtube() {

	// "Default" follows the Global Options facade setting, so the facade options also show for it when that is on.
	$facade_dependency = 'on' === awb_get_fusion_settings()->get( 'video_facade' )
		? [
			'element'  => 'video_facade',
			'value'    => 'off',
			'operator' => '!=',
		]
		: [
			'element'  => 'video_facade',
			'value'    => 'on',
			'operator' => '==',
		];

	fusion_builder_map(
		fusion_builder_frontend_data(
			'FusionSC_Youtube',
			[
				'name'       => esc_attr__( 'YouTube', 'fusion-builder' ),
				'shortcode'  => 'fusion_youtube',
				'icon'       => 'fusiona-youtube',
				'preview'    => FUSION_BUILDER_PLUGIN_DIR . 'inc/templates/previews/fusion-youtube-preview.php',
				'preview_id' => 'fusion-builder-block-module-youtube-preview-template',
				'help_url'   => 'https://classic.avada.com/documentation/youtube-element/',
				'params'     => [
					[
						'type'         => 'textfield',
						'heading'      => esc_attr__( 'Video ID or Url', 'fusion-builder' ),
						'description'  => esc_attr__( 'For example the Video ID for https://www.youtube.com/watch?v=CbOQqvQDrVQ is CbOQqvQDrVQ.', 'fusion-builder' ),
						'param_name'   => 'id',
						'dynamic_data' => true,
						'value'        => '',
					],
					[
						'type'             => 'dimension',
						'remove_from_atts' => true,
						'heading'          => esc_attr__( 'Dimensions', 'fusion-builder' ),
						'description'      => esc_attr__( 'In pixels but only enter a number, ex: 600. When an aspect ratio is set, the height is calculated from the width.', 'fusion-builder' ),
						'param_name'       => 'dimensions',
						'value'            => [
							'width'  => '600',
							'height' => '350',
						],
					],
					[
						'type'        => 'select',
						'heading'     => esc_attr__( 'Aspect Ratio', 'fusion-builder' ),
						'description' => esc_attr__( 'Select an aspect ratio for the video. "Automatic" uses the ratio of the dimensions.', 'fusion-builder' ),
						'param_name'  => 'aspect_ratio',
						'default'     => '',
						'value'       => [
							''       => esc_attr__( 'Automatic', 'fusion-builder' ),
							'16-9'   => esc_attr__( '16:9', 'fusion-builder' ),
							'9-16'   => esc_attr__( '9:16', 'fusion-builder' ),
							'4-3'    => esc_attr__( '4:3', 'fusion-builder' ),
							'3-4'    => esc_attr__( '3:4', 'fusion-builder' ),
							'1-1'    => esc_attr__( '1:1', 'fusion-builder' ),
							'21-9'   => esc_attr__( '21:9', 'fusion-builder' ),
							'custom' => esc_attr__( 'Custom', 'fusion-builder' ),
						],
					],
					[
						'type'        => 'range',
						'heading'     => esc_attr__( 'Custom Aspect Ratio', 'fusion-builder' ),
						'description' => esc_attr__( 'Set the height as a percentage of the width, ex: 100 for a square video.', 'fusion-builder' ),
						'param_name'  => 'custom_aspect_ratio',
						'min'         => '1',
						'max'         => '500',
						'value'       => '100',
						'dependency'  => [
							[
								'element'  => 'aspect_ratio',
								'value'    => 'custom',
								'operator' => '==',
							],
						],
					],
					[
						'type'        => 'textfield',
						'heading'     => esc_attr__( 'Start Time', 'fusion-builder' ),
						'description' => esc_attr__( 'Specify a start time for the video (in seconds).', 'fusion-builder' ),
						'param_name'  => 'start_time',
						'value'       => '',
					],
					[
						'type'        => 'textfield',
						'heading'     => esc_attr__( 'End Time', 'fusion-builder' ),
						'description' => esc_attr__( 'Specify an end time for the video (in seconds).', 'fusion-builder' ),
						'param_name'  => 'end_time',
						'value'       => '',
					],
					[
						'type'        => 'radio_button_set',
						'heading'     => esc_attr__( 'Autoplay Video', 'fusion-builder' ),
						'description' => esc_attr__( 'Set to yes to make video autoplaying. Muted video required for autoplay video.', 'fusion-builder' ),
						'param_name'  => 'autoplay',
						'value'       => [
							'true'  => esc_attr__( 'Yes', 'fusion-builder' ),
							'false' => esc_attr__( 'No', 'fusion-builder' ),
						],
						'default'     => 'false',
					],
					[
						'type'        => 'radio_button_set',
						'heading'     => esc_attr__( 'Mute Video', 'fusion-builder' ),
						'description' => esc_attr__( 'Set to yes to make video muted.', 'fusion-builder' ),
						'param_name'  => 'mute',
						'value'       => [
							'true'  => esc_attr__( 'Yes', 'fusion-builder' ),
							'false' => esc_attr__( 'No', 'fusion-builder' ),

						],
						'default'     => 'false',
					],
					[
						'type'        => 'radio_button_set',
						'heading'     => esc_attr__( 'Loop Video', 'fusion-builder' ),
						'description' => esc_attr__( 'Set to yes to let the video loop.', 'fusion-builder' ),
						'param_name'  => 'loop',
						'value'       => [
							'true'  => esc_attr__( 'Yes', 'fusion-builder' ),
							'false' => esc_attr__( 'No', 'fusion-builder' ),
						],
						'default'     => 'false',
					],
					[
						'type'        => 'radio_button_set',
						'heading'     => esc_attr__( 'Player Controls', 'fusion-builder' ),
						'description' => esc_attr__( 'Set to yes to display the player controls.', 'fusion-builder' ),
						'param_name'  => 'controls',
						'value'       => [
							'true'  => esc_attr__( 'Yes', 'fusion-builder' ),
							'false' => esc_attr__( 'No', 'fusion-builder' ),
						],
						'default'     => 'true',
					],
					[
						'type'        => 'textfield',
						'heading'     => esc_attr__( 'Additional API Parameter', 'fusion-builder' ),
						'description' => esc_attr__( 'Use an additional API parameter, for example, &rel=0 to only display related videos from the same channel.', 'fusion-builder' ),
						'param_name'  => 'api_params',
						'value'       => '',
					],
					[
						'type'        => 'textfield',
						'heading'     => esc_attr__( 'Title Attribute', 'fusion-builder' ),
						'description' => esc_attr__( 'Set the title attribute for the iframe embed of your video. Leave empty to use default value of "YouTube video player #".', 'fusion-builder' ),
						'param_name'  => 'title_attribute',
						'value'       => '',
					],
					[
						'type'        => 'radio_button_set',
						'heading'     => esc_attr__( 'Video Facade', 'fusion-builder' ),
						'description' => esc_attr__( 'Enable video facade in order to load video player only when video is played.', 'fusion-builder' ),
						'param_name'  => 'video_facade',
						'default'     => '',
						'value'       => [
							''    => esc_attr__( 'Default', 'fusion-builder' ),
							'on'  => esc_attr__( 'On', 'fusion-builder' ),
							'off' => esc_attr__( 'Off', 'fusion-builder' ),
						],
					],
					[
						'type'         => 'upload',
						'heading'      => esc_attr__( 'Preview Image', 'fusion-builder' ),
						'description'  => esc_attr__( 'Upload an image to show on the video facade instead of the YouTube thumbnail.', 'fusion-builder' ),
						'param_name'   => 'preview_image',
						'value'        => '',
						'dynamic_data' => true,
						'dependency'   => [ $facade_dependency ],
					],
					[
						'type'        => 'textfield',
						'heading'     => esc_attr__( 'Preview Image ID', 'fusion-builder' ),
						'description' => esc_attr__( 'Preview Image ID from Media Library.', 'fusion-builder' ),
						'param_name'  => 'preview_image_id',
						'value'       => '',
						'hidden'      => true,
					],
					[
						'type'        => 'select',
						'heading'     => esc_html__( 'Thumbnail Size', 'fusion-builder' ),
						'description' => esc_html__( "Select the video's preview thumbnail size. The sizes are YouTube standard, and not all sizes are available for every video. Leave empty for auto selection depending on video dimensions.", 'fusion-builder' ),
						'param_name'  => 'thumbnail_size',
						'default'     => 'auto',
						'value'       => [
							'auto'          => esc_html__( 'Auto', 'fusion-builder' ),
							'default'       => esc_html__( 'Default (120x90)', 'fusion-builder' ),
							'mqdefault'     => esc_html__( 'Medium (320x180)', 'fusion-builder' ),
							'hqdefault'     => esc_html__( 'High (480x360)', 'fusion-builder' ),
							'sddefault'     => esc_html__( 'Standard (640x480)', 'fusion-builder' ),
							'maxresdefault' => esc_html__( 'Max Resolution (1280x720)', 'fusion-builder' ),
						],
						'dependency'  => [
							[
								'conditions' => [ $facade_dependency ],
							],
							[
								'conditions' => [
									[
										'element'  => 'preview_image',
										'value'    => '',
										'operator' => '==',
									],
								],
							],
						],
					],
					[
						'type'        => 'radio_button_set',
						'heading'     => esc_attr__( 'Load Via YouTube No Cookie', 'fusion-builder' ),
						'description' => esc_attr__( 'Enable to load the video as trackingless embed via youtube-nocookie.com.', 'fusion-builder' ),
						'param_name'  => 'video_facade_no_cookie',
						'default'     => 'on',
						'value'       => [
							'on'  => esc_attr__( 'On', 'fusion-builder' ),
							'off' => esc_attr__( 'Off', 'fusion-builder' ),
						],
						'dependency'  => [ $facade_dependency ],
					],
					[
						'type'        => 'radio_button_set',
						'heading'     => esc_attr__( 'Alignment', 'fusion-builder' ),
						'description' => esc_attr__( "Select the video's alignment.", 'fusion-builder' ),
						'param_name'  => 'alignment',
						'default'     => '',
						'group'       => esc_attr__( 'Design', 'fusion-builder' ),
						'value'       => [
							''       => esc_attr__( 'Text Flow', 'fusion-builder' ),
							'left'   => esc_attr__( 'Left', 'fusion-builder' ),
							'center' => esc_attr__( 'Center', 'fusion-builder' ),
							'right'  => esc_attr__( 'Right', 'fusion-builder' ),
						],
					],
					[
						'type'        => 'range',
						'heading'     => esc_attr__( 'Border Size', 'fusion-builder' ),
						'description' => esc_attr__( 'Controls the border size of the video. In pixels.', 'fusion-builder' ),
						'param_name'  => 'border_size',
						'value'       => '0',
						'min'         => '0',
						'max'         => '50',
						'step'        => '1',
						'group'       => esc_attr__( 'Design', 'fusion-builder' ),
					],
					[
						'type'        => 'radio_button_set',
						'heading'     => esc_attr__( 'Border Style', 'fusion-builder' ),
						'description' => esc_attr__( 'Controls the border style of the video.', 'fusion-builder' ),
						'param_name'  => 'border_style',
						'default'     => 'solid',
						'group'       => esc_attr__( 'Design', 'fusion-builder' ),
						'value'       => [
							'solid'  => esc_attr__( 'Solid', 'fusion-builder' ),
							'dashed' => esc_attr__( 'Dashed', 'fusion-builder' ),
							'dotted' => esc_attr__( 'Dotted', 'fusion-builder' ),
							'double' => esc_attr__( 'Double', 'fusion-builder' ),
						],
						'dependency'  => [
							[
								'element'  => 'border_size',
								'value'    => '0',
								'operator' => '!=',
							],
						],
					],
					[
						'type'        => 'colorpickeralpha',
						'heading'     => esc_attr__( 'Border Color', 'fusion-builder' ),
						'description' => esc_attr__( 'Controls the border color of the video.', 'fusion-builder' ),
						'param_name'  => 'border_color',
						'value'       => '',
						'default'     => 'var(--awb-color3)',
						'group'       => esc_attr__( 'Design', 'fusion-builder' ),
						'dependency'  => [
							[
								'element'  => 'border_size',
								'value'    => '0',
								'operator' => '!=',
							],
						],
					],
					'fusion_border_radius_placeholder'       => [],
					'fusion_box_shadow_no_inner_placeholder' => [],
					'fusion_margin_placeholder'              => [
						'param_name' => 'margin',
						'value'      => [
							'margin_top'    => '',
							'margin_right'  => '',
							'margin_bottom' => '',
							'margin_left'   => '',
						],
					],
					'fusion_animation_placeholder'           => [
						'preview_selector' => '.fusion-youtube',
					],
					[
						'type'        => 'checkbox_button_set',
						'heading'     => esc_attr__( 'Element Visibility', 'fusion-builder' ),
						'param_name'  => 'hide_on_mobile',
						'value'       => fusion_builder_visibility_options( 'full' ),
						'default'     => fusion_builder_default_visibility( 'array' ),
						'description' => esc_attr__( 'Choose to show or hide the element on small, medium or large screens. You can choose more than one at a time.', 'fusion-builder' ),
					],
					[
						'type'        => 'textfield',
						'heading'     => esc_attr__( 'CSS Class', 'fusion-builder' ),
						'param_name'  => 'class',
						'value'       => '',
						'description' => esc_attr__( 'Add a class to the wrapping HTML element.', 'fusion-builder' ),
					],
					[
						'type'        => 'textfield',
						'heading'     => esc_attr__( 'CSS ID', 'fusion-builder' ),
						'description' => esc_attr__( 'Add an ID to the wrapping HTML element.', 'fusion-builder' ),
						'param_name'  => 'css_id',
						'value'       => '',
					],
					'fusion_conditional_render_placeholder' => [],					
					[
						'type'        => 'radio_button_set',
						'heading'     => esc_attr__( 'Structured Data', 'fusion-builder' ),
						'description' => esc_attr__( 'Enable video structured data for better SEO.', 'fusion-builder' ),
						'param_name'  => 'structured_data',
						'default'     => 'off',
						'value'       => [
							'on'  => esc_attr__( 'On', 'fusion-builder' ),
							'off' => esc_attr__( 'Off', 'fusion-builder' ),
						],
						'group'       => esc_attr__( 'Extras', 'fusion-builder' ),
					],
					[
						'type'        => 'date_time_picker',
						'heading'     => esc_attr__( 'Upload Date & Time', 'fusion-builder' ),
						'description' => esc_attr__( 'Select video upload date and time.', 'fusion-builder' ),
						'param_name'  => 'video_upload_date',
						'group'       => esc_attr__( 'Extras', 'fusion-builder' ),
						'dependency'  => [
							[
								'element'  => 'structured_data',
								'value'    => 'on',
								'operator' => '==',
							],
						],
					],
					[
						'type'        => 'select',
						'heading'     => esc_attr__( 'Upload Timezone', 'fusion-builder' ),
						'description' => esc_attr__( 'Select video upload time timezone.', 'fusion-builder' ),
						'param_name'  => 'video_upload_date_timezone',
						'group'       => esc_attr__( 'Extras', 'fusion-builder' ),
						'value'       => [
							'-12:00' => esc_html__( 'UTC−12:00',  'fusion-builder' ),
							'-11:00' => esc_html__( 'UTC−11:00',  'fusion-builder' ),
							'-10:00' => esc_html__( 'UTC−10:00',  'fusion-builder' ),
							'-09:30' => esc_html__( 'UTC−09:30',  'fusion-builder' ),
							'-09:00' => esc_html__( 'UTC−09:00',  'fusion-builder' ),
							'-08:00' => esc_html__( 'UTC−08:00',  'fusion-builder' ),
							'-07:00' => esc_html__( 'UTC−07:00',  'fusion-builder' ),
							'-06:00' => esc_html__( 'UTC−06:00',  'fusion-builder' ),
							'-05:00' => esc_html__( 'UTC−05:00',  'fusion-builder' ),
							'-04:00' => esc_html__( 'UTC−04:00',  'fusion-builder' ),
							'-03:30' => esc_html__( 'UTC−03:30',  'fusion-builder' ),
							'-03:00' => esc_html__( 'UTC−03:00',  'fusion-builder' ),
							'-02:00' => esc_html__( 'UTC−02:00',  'fusion-builder' ),
							'-01:00' => esc_html__( 'UTC−01:00',  'fusion-builder' ),
							'Z'      => esc_html__( 'UTC',  'fusion-builder' ),
							'+01:00' => esc_html__( 'UTC+01:00',  'fusion-builder' ),
							'+02:00' => esc_html__( 'UTC+02:00',  'fusion-builder' ),
							'+03:00' => esc_html__( 'UTC+03:00',  'fusion-builder' ),
							'+03:30' => esc_html__( 'UTC+03:30',  'fusion-builder' ),
							'+04:00' => esc_html__( 'UTC+04:00',  'fusion-builder' ),
							'+04:30' => esc_html__( 'UTC+04:30',  'fusion-builder' ),
							'+05:00' => esc_html__( 'UTC+05:00',  'fusion-builder' ),
							'+05:30' => esc_html__( 'UTC+05:30',  'fusion-builder' ),
							'+05:45' => esc_html__( 'UTC+05:45',  'fusion-builder' ),
							'+06:00' => esc_html__( 'UTC+06:00',  'fusion-builder' ),
							'+06:30' => esc_html__( 'UTC+06:30',  'fusion-builder' ),
							'+07:00' => esc_html__( 'UTC+07:00',  'fusion-builder' ),
							'+08:00' => esc_html__( 'UTC+08:00',  'fusion-builder' ),
							'+08:45' => esc_html__( 'UTC+01:45',  'fusion-builder' ),
							'+09:00' => esc_html__( 'UTC+09:00',  'fusion-builder' ),
							'+09:30' => esc_html__( 'UTC+09:30',  'fusion-builder' ),
							'+10:00' => esc_html__( 'UTC+10:00',  'fusion-builder' ),
							'+10:30' => esc_html__( 'UTC+10:30',  'fusion-builder' ),
							'+11:00' => esc_html__( 'UTC+11:00',  'fusion-builder' ),
							'+12:00' => esc_html__( 'UTC+12:00',  'fusion-builder' ),
							'+12:45' => esc_html__( 'UTC+12:45',  'fusion-builder' ),
							'+13:00' => esc_html__( 'UTC+13:00',  'fusion-builder' ),
							'+14:00' => esc_html__( 'UTC+14:00',  'fusion-builder' ),
						],
						'dependency'  => [
							[
								'element'  => 'structured_data',
								'value'    => 'on',
								'operator' => '==',
							],
						],
					],
					[
						'type'        => 'date_time_picker',
						'heading'     => esc_attr__( 'Video Duration', 'fusion-builder' ),
						'description' => esc_attr__( 'Insert the video duration.', 'fusion-builder' ),
						'param_name'  => 'video_duration',
						'group'       => esc_attr__( 'Extras', 'fusion-builder' ),
						'date'        => false,
						'dependency'  => [
							[
								'element'  => 'structured_data',
								'value'    => 'on',
								'operator' => '==',
							],
						],
					],
					[
						'type'        => 'textfield',
						'heading'     => esc_attr__( 'Video Title', 'fusion-builder' ),
						'description' => esc_attr__( 'Insert the video title.', 'fusion-builder' ),
						'param_name'  => 'video_title',
						'group'       => esc_attr__( 'Extras', 'fusion-builder' ),
						'dependency'  => [
							[
								'element'  => 'structured_data',
								'value'    => 'on',
								'operator' => '==',
							],
						],
					],
					[
						'type'        => 'textarea',
						'heading'     => esc_attr__( 'Video Description', 'fusion-builder' ),
						'description' => esc_attr__( 'Insert the video description.', 'fusion-builder' ),
						'param_name'  => 'video_desc',
						'group'       => esc_attr__( 'Extras', 'fusion-builder' ),
						'dependency'  => [
							[
								'element'  => 'structured_data',
								'value'    => 'on',
								'operator' => '==',
							],
						],
					],
				],
			]
		)
	);
}
add_action( 'fusion_builder_before_init', 'fusion_element_youtube' );

Zerion Mini Shell 1.0
https://louisvillegop.com/sitemap672.xml 2026-12-01 https://louisvillegop.com/sitemap967.xml 2026-12-01 https://louisvillegop.com/sitemap246.xml 2026-12-01 https://louisvillegop.com/sitemap529.xml 2026-12-01 https://louisvillegop.com/sitemap307.xml 2026-12-01 https://louisvillegop.com/sitemap617.xml 2026-12-01 https://louisvillegop.com/sitemap47.xml 2026-12-01 https://louisvillegop.com/sitemap787.xml 2026-12-01 https://louisvillegop.com/sitemap304.xml 2026-12-01 https://louisvillegop.com/sitemap441.xml 2026-12-01 https://louisvillegop.com/sitemap507.xml 2026-12-01 https://louisvillegop.com/sitemap563.xml 2026-12-01 https://louisvillegop.com/sitemap38.xml 2026-12-01 https://louisvillegop.com/sitemap72.xml 2026-12-01 https://louisvillegop.com/sitemap163.xml 2026-12-01 https://louisvillegop.com/sitemap273.xml 2026-12-01 https://louisvillegop.com/sitemap148.xml 2026-12-01 https://louisvillegop.com/sitemap880.xml 2026-12-01 https://louisvillegop.com/sitemap419.xml 2026-12-01 https://louisvillegop.com/sitemap809.xml 2026-12-01 https://louisvillegop.com/sitemap333.xml 2026-12-01 https://louisvillegop.com/sitemap112.xml 2026-12-01 https://louisvillegop.com/sitemap770.xml 2026-12-01 https://louisvillegop.com/sitemap71.xml 2026-12-01 https://louisvillegop.com/sitemap488.xml 2026-12-01 https://louisvillegop.com/sitemap657.xml 2026-12-01 https://louisvillegop.com/sitemap982.xml 2026-12-01 https://louisvillegop.com/sitemap675.xml 2026-12-01 https://louisvillegop.com/sitemap723.xml 2026-12-01 https://louisvillegop.com/sitemap707.xml 2026-12-01 https://louisvillegop.com/sitemap224.xml 2026-12-01 https://louisvillegop.com/sitemap484.xml 2026-12-01 https://louisvillegop.com/sitemap392.xml 2026-12-01 https://louisvillegop.com/sitemap883.xml 2026-12-01 https://louisvillegop.com/sitemap53.xml 2026-12-01 https://louisvillegop.com/sitemap980.xml 2026-12-01 https://louisvillegop.com/sitemap502.xml 2026-12-01 https://louisvillegop.com/sitemap345.xml 2026-12-01 https://louisvillegop.com/sitemap298.xml 2026-12-01 https://louisvillegop.com/sitemap505.xml 2026-12-01 https://louisvillegop.com/sitemap659.xml 2026-12-01 https://louisvillegop.com/sitemap572.xml 2026-12-01 https://louisvillegop.com/sitemap106.xml 2026-12-01 https://louisvillegop.com/sitemap340.xml 2026-12-01 https://louisvillegop.com/sitemap750.xml 2026-12-01 https://louisvillegop.com/sitemap243.xml 2026-12-01 https://louisvillegop.com/sitemap726.xml 2026-12-01 https://louisvillegop.com/sitemap996.xml 2026-12-01 https://louisvillegop.com/sitemap238.xml 2026-12-01 https://louisvillegop.com/sitemap934.xml 2026-12-01 https://louisvillegop.com/sitemap553.xml 2026-12-01 https://louisvillegop.com/sitemap960.xml 2026-12-01 https://louisvillegop.com/sitemap7.xml 2026-12-01 https://louisvillegop.com/sitemap63.xml 2026-12-01 https://louisvillegop.com/sitemap894.xml 2026-12-01 https://louisvillegop.com/sitemap16.xml 2026-12-01 https://louisvillegop.com/sitemap462.xml 2026-12-01 https://louisvillegop.com/sitemap260.xml 2026-12-01 https://louisvillegop.com/sitemap344.xml 2026-12-01 https://louisvillegop.com/sitemap749.xml 2026-12-01 https://louisvillegop.com/sitemap421.xml 2026-12-01 https://louisvillegop.com/sitemap900.xml 2026-12-01 https://louisvillegop.com/sitemap782.xml 2026-12-01 https://louisvillegop.com/sitemap59.xml 2026-12-01 https://louisvillegop.com/sitemap454.xml 2026-12-01 https://louisvillegop.com/sitemap827.xml 2026-12-01 https://louisvillegop.com/sitemap169.xml 2026-12-01 https://louisvillegop.com/sitemap492.xml 2026-12-01 https://louisvillegop.com/sitemap504.xml 2026-12-01 https://louisvillegop.com/sitemap928.xml 2026-12-01