Edit File by line
/home/barbar84/www/wp-conte.../themes/Divi/includes/builder/module
File: VideoSliderItem.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class ET_Builder_Module_Video_Slider_Item extends ET_Builder_Module {
[2] Fix | Delete
function init() {
[3] Fix | Delete
$this->name = esc_html__( 'Video', 'et_builder' );
[4] Fix | Delete
$this->plural = esc_html__( 'Videos', 'et_builder' );
[5] Fix | Delete
$this->slug = 'et_pb_video_slider_item';
[6] Fix | Delete
$this->vb_support = 'on';
[7] Fix | Delete
$this->type = 'child';
[8] Fix | Delete
$this->custom_css_tab = false;
[9] Fix | Delete
$this->child_title_var = 'admin_title';
[10] Fix | Delete
$this->advanced_setting_title_text = esc_html__( 'New Video', 'et_builder' );
[11] Fix | Delete
$this->settings_text = esc_html__( 'Video Settings', 'et_builder' );
[12] Fix | Delete
[13] Fix | Delete
$this->settings_modal_toggles = array(
[14] Fix | Delete
'general' => array(
[15] Fix | Delete
'toggles' => array(
[16] Fix | Delete
'main_content' => esc_html__( 'Video', 'et_builder' ),
[17] Fix | Delete
'overlay' => et_builder_i18n( 'Overlay' ),
[18] Fix | Delete
'admin_label' => et_builder_i18n( 'Admin Label' ),
[19] Fix | Delete
),
[20] Fix | Delete
),
[21] Fix | Delete
'advanced' => array(
[22] Fix | Delete
'toggles' => array(
[23] Fix | Delete
'arrows_color' => esc_html__( 'Controls', 'et_builder' ),
[24] Fix | Delete
),
[25] Fix | Delete
),
[26] Fix | Delete
);
[27] Fix | Delete
[28] Fix | Delete
$this->advanced_fields = array(
[29] Fix | Delete
'text' => array(
[30] Fix | Delete
'use_text_orientation' => false,
[31] Fix | Delete
'use_background_layout' => true,
[32] Fix | Delete
'options' => array(
[33] Fix | Delete
'background_layout' => array(
[34] Fix | Delete
'label' => esc_html__( 'Slider Arrows Color', 'et_builder' ),
[35] Fix | Delete
'option_category' => 'color_option',
[36] Fix | Delete
'toggle_slug' => 'arrows_color',
[37] Fix | Delete
'description' => esc_html__( 'This setting will make your slider arrows either light or dark in color.', 'et_builder' ),
[38] Fix | Delete
'default' => 'dark',
[39] Fix | Delete
'default_on_child' => true,
[40] Fix | Delete
'hover' => 'tabs',
[41] Fix | Delete
'priority' => 1,
[42] Fix | Delete
),
[43] Fix | Delete
),
[44] Fix | Delete
),
[45] Fix | Delete
'box_shadow' => array(
[46] Fix | Delete
'default' => false,
[47] Fix | Delete
),
[48] Fix | Delete
'borders' => array(
[49] Fix | Delete
'default' => false,
[50] Fix | Delete
),
[51] Fix | Delete
'text_shadow' => array(
[52] Fix | Delete
'default' => false,
[53] Fix | Delete
),
[54] Fix | Delete
'background' => false,
[55] Fix | Delete
'fonts' => false,
[56] Fix | Delete
'max_width' => false,
[57] Fix | Delete
'height' => false,
[58] Fix | Delete
'margin_padding' => false,
[59] Fix | Delete
'button' => false,
[60] Fix | Delete
'link_options' => false,
[61] Fix | Delete
'scroll_effects' => false,
[62] Fix | Delete
);
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
function get_fields() {
[66] Fix | Delete
$fields = array(
[67] Fix | Delete
'admin_title' => array(
[68] Fix | Delete
'label' => et_builder_i18n( 'Admin Label' ),
[69] Fix | Delete
'type' => 'text',
[70] Fix | Delete
'description' => esc_html__( 'This will change the label of the video in the builder for easy identification.', 'et_builder' ),
[71] Fix | Delete
'toggle_slug' => 'admin_label',
[72] Fix | Delete
),
[73] Fix | Delete
'src' => array(
[74] Fix | Delete
'label' => esc_html__( 'Video MP4/URL', 'et_builder' ),
[75] Fix | Delete
'type' => 'upload',
[76] Fix | Delete
'option_category' => 'basic_option',
[77] Fix | Delete
'data_type' => 'video',
[78] Fix | Delete
'upload_button_text' => esc_attr__( 'Upload a video', 'et_builder' ),
[79] Fix | Delete
'choose_text' => esc_attr__( 'Choose a Video MP4 File', 'et_builder' ),
[80] Fix | Delete
'update_text' => esc_attr__( 'Set As Video', 'et_builder' ),
[81] Fix | Delete
'description' => esc_html__( 'Upload your desired video in .MP4 format, or type in the URL to the video you would like to display', 'et_builder' ),
[82] Fix | Delete
'toggle_slug' => 'main_content',
[83] Fix | Delete
'computed_affects' => array(
[84] Fix | Delete
'__get_oembed',
[85] Fix | Delete
'__oembed_thumbnail',
[86] Fix | Delete
'__is_oembed',
[87] Fix | Delete
),
[88] Fix | Delete
'mobile_options' => true,
[89] Fix | Delete
'hover' => 'tabs',
[90] Fix | Delete
),
[91] Fix | Delete
'src_webm' => array(
[92] Fix | Delete
'label' => esc_html__( 'Video Webm', 'et_builder' ),
[93] Fix | Delete
'type' => 'upload',
[94] Fix | Delete
'option_category' => 'basic_option',
[95] Fix | Delete
'data_type' => 'video',
[96] Fix | Delete
'upload_button_text' => esc_attr__( 'Upload a video', 'et_builder' ),
[97] Fix | Delete
'choose_text' => esc_attr__( 'Choose a Video WEBM File', 'et_builder' ),
[98] Fix | Delete
'update_text' => esc_attr__( 'Set As Video', 'et_builder' ),
[99] Fix | Delete
'description' => esc_html__( 'Upload the .WEBM version of your video here. All uploaded videos should be in both .MP4 .WEBM formats to ensure maximum compatibility in all browsers.', 'et_builder' ),
[100] Fix | Delete
'toggle_slug' => 'main_content',
[101] Fix | Delete
'mobile_options' => true,
[102] Fix | Delete
'hover' => 'tabs',
[103] Fix | Delete
),
[104] Fix | Delete
'image_src' => array(
[105] Fix | Delete
'label' => esc_html__( 'Image Overlay URL', 'et_builder' ),
[106] Fix | Delete
'type' => 'upload',
[107] Fix | Delete
'option_category' => 'basic_option',
[108] Fix | Delete
'upload_button_text' => et_builder_i18n( 'Upload an image' ),
[109] Fix | Delete
'choose_text' => esc_attr__( 'Choose an Image', 'et_builder' ),
[110] Fix | Delete
'update_text' => esc_attr__( 'Set As Image', 'et_builder' ),
[111] Fix | Delete
'additional_button' => sprintf(
[112] Fix | Delete
'<input type="button" class="button et-pb-video-image-button" value="%1$s" />',
[113] Fix | Delete
esc_attr__( 'Generate From Video', 'et_builder' )
[114] Fix | Delete
),
[115] Fix | Delete
'additional_button_type' => 'generate_image_url_from_video',
[116] Fix | Delete
'additional_button_attrs' => array(
[117] Fix | Delete
'video_source' => 'src',
[118] Fix | Delete
),
[119] Fix | Delete
'classes' => 'et_pb_video_overlay',
[120] Fix | Delete
'description' => esc_html__( 'Upload your desired image, or type in the URL to the image you would like to display over your video. You can also generate a still image from your video.', 'et_builder' ),
[121] Fix | Delete
'toggle_slug' => 'overlay',
[122] Fix | Delete
'dynamic_content' => 'image',
[123] Fix | Delete
'mobile_options' => true,
[124] Fix | Delete
'hover' => 'tabs',
[125] Fix | Delete
),
[126] Fix | Delete
'__oembed_thumbnail' => array(
[127] Fix | Delete
'type' => 'computed',
[128] Fix | Delete
'computed_callback' => array( 'ET_Builder_Module_Video_Slider_Item', 'get_oembed_thumbnail' ),
[129] Fix | Delete
'computed_depends_on' => array(
[130] Fix | Delete
'src',
[131] Fix | Delete
'image_src',
[132] Fix | Delete
),
[133] Fix | Delete
'computed_minimum' => array(
[134] Fix | Delete
'src',
[135] Fix | Delete
),
[136] Fix | Delete
),
[137] Fix | Delete
'__is_oembed' => array(
[138] Fix | Delete
'type' => 'computed',
[139] Fix | Delete
'computed_callback' => array( 'ET_Builder_Module_Video_Slider_Item', 'is_oembed' ),
[140] Fix | Delete
'computed_depends_on' => array(
[141] Fix | Delete
'src',
[142] Fix | Delete
),
[143] Fix | Delete
'computed_minimum' => array(
[144] Fix | Delete
'src',
[145] Fix | Delete
),
[146] Fix | Delete
),
[147] Fix | Delete
'__get_oembed' => array(
[148] Fix | Delete
'type' => 'computed',
[149] Fix | Delete
'computed_callback' => array( 'ET_Builder_Module_Video_Slider_Item', 'get_oembed' ),
[150] Fix | Delete
'computed_depends_on' => array(
[151] Fix | Delete
'src',
[152] Fix | Delete
),
[153] Fix | Delete
'computed_minimum' => array(
[154] Fix | Delete
'src',
[155] Fix | Delete
),
[156] Fix | Delete
),
[157] Fix | Delete
'play_icon_color' => array(
[158] Fix | Delete
'label' => esc_html__( 'Play Icon Color', 'et_builder' ),
[159] Fix | Delete
'description' => esc_html__( 'Here you can define a custom color for the play icon.', 'et_builder' ),
[160] Fix | Delete
'type' => 'color-alpha',
[161] Fix | Delete
'custom_color' => true,
[162] Fix | Delete
'tab_slug' => 'advanced',
[163] Fix | Delete
'toggle_slug' => 'arrows_color',
[164] Fix | Delete
'hover' => 'tabs',
[165] Fix | Delete
'mobile_options' => true,
[166] Fix | Delete
'sticky' => true,
[167] Fix | Delete
'priority' => 5,
[168] Fix | Delete
),
[169] Fix | Delete
'use_icon_font_size' => array(
[170] Fix | Delete
'label' => esc_html__( 'Use Play Icon Font Size', 'et_builder' ),
[171] Fix | Delete
'description' => esc_html__( 'If you would like to control the size of the icon, you must first enable this option.', 'et_builder' ),
[172] Fix | Delete
'type' => 'yes_no_button',
[173] Fix | Delete
'options' => array(
[174] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[175] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[176] Fix | Delete
),
[177] Fix | Delete
'default_on_front' => 'off',
[178] Fix | Delete
'affects' => array(
[179] Fix | Delete
'icon_font_size',
[180] Fix | Delete
),
[181] Fix | Delete
'tab_slug' => 'advanced',
[182] Fix | Delete
'toggle_slug' => 'arrows_color',
[183] Fix | Delete
'option_category' => 'font_option',
[184] Fix | Delete
),
[185] Fix | Delete
'icon_font_size' => array(
[186] Fix | Delete
'label' => esc_html__( 'Play Icon Font Size', 'et_builder' ),
[187] Fix | Delete
'description' => esc_html__( 'Control the size of the icon by increasing or decreasing the font size.', 'et_builder' ),
[188] Fix | Delete
'type' => 'range',
[189] Fix | Delete
'option_category' => 'font_option',
[190] Fix | Delete
'tab_slug' => 'advanced',
[191] Fix | Delete
'toggle_slug' => 'arrows_color',
[192] Fix | Delete
'allowed_units' => array( '%', 'em', 'rem', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ex', 'vh', 'vw' ),
[193] Fix | Delete
'default' => '96px',
[194] Fix | Delete
'default_unit' => 'px',
[195] Fix | Delete
'default_on_front' => '',
[196] Fix | Delete
'range_settings' => array(
[197] Fix | Delete
'min' => '1',
[198] Fix | Delete
'max' => '120',
[199] Fix | Delete
'step' => '1',
[200] Fix | Delete
),
[201] Fix | Delete
'mobile_options' => true,
[202] Fix | Delete
'depends_show_if' => 'on',
[203] Fix | Delete
'responsive' => true,
[204] Fix | Delete
'sticky' => true,
[205] Fix | Delete
'hover' => 'tabs',
[206] Fix | Delete
),
[207] Fix | Delete
);
[208] Fix | Delete
return $fields;
[209] Fix | Delete
}
[210] Fix | Delete
[211] Fix | Delete
public function get_transition_fields_css_props() {
[212] Fix | Delete
$fields = parent::get_transition_fields_css_props();
[213] Fix | Delete
[214] Fix | Delete
$fields['background_layout'] = array( 'color' => '%%order_class%% .et-pb-arrow-prev, %%order_class%% .et-pb-arrow-next' );
[215] Fix | Delete
$fields['play_icon_color'] = array( 'color' => '%%order_class%%.et_pb_slide .et_pb_video_play' );
[216] Fix | Delete
$fields['icon_font_size'] = array(
[217] Fix | Delete
'font-size' => '%%order_class%%.et_pb_slide .et_pb_video_play',
[218] Fix | Delete
'margin-left' => '%%order_class%%.et_pb_slide .et_pb_video_play',
[219] Fix | Delete
'margin-top' => '%%order_class%%.et_pb_slide .et_pb_video_play',
[220] Fix | Delete
'line-height' => '%%order_class%%.et_pb_slide .et_pb_video_play',
[221] Fix | Delete
);
[222] Fix | Delete
[223] Fix | Delete
return $fields;
[224] Fix | Delete
}
[225] Fix | Delete
[226] Fix | Delete
protected static function resolve_oembed_thumbnail( $src, $post_id ) {
[227] Fix | Delete
$dynamic_value = et_builder_parse_dynamic_content( $src );
[228] Fix | Delete
if ( $dynamic_value->is_dynamic() && current_user_can( 'edit_post', $post_id ) ) {
[229] Fix | Delete
return $dynamic_value->resolve( $post_id );
[230] Fix | Delete
}
[231] Fix | Delete
[232] Fix | Delete
return $src;
[233] Fix | Delete
}
[234] Fix | Delete
[235] Fix | Delete
static function get_oembed_thumbnail( $args = array(), $conditional_tags = array(), $current_page = array() ) {
[236] Fix | Delete
$post_id = isset( $current_page['id'] ) ? $current_page['id'] : self::get_current_post_id();
[237] Fix | Delete
$defaults = array(
[238] Fix | Delete
'image_src' => '',
[239] Fix | Delete
'src' => '',
[240] Fix | Delete
);
[241] Fix | Delete
[242] Fix | Delete
$args = wp_parse_args( $args, $defaults );
[243] Fix | Delete
[244] Fix | Delete
if ( '' !== $args['image_src'] ) {
[245] Fix | Delete
return et_pb_set_video_oembed_thumbnail_resolution(
[246] Fix | Delete
self::resolve_oembed_thumbnail( $args['image_src'], $post_id ),
[247] Fix | Delete
'high'
[248] Fix | Delete
);
[249] Fix | Delete
} else {
[250] Fix | Delete
if ( false !== et_pb_check_oembed_provider( esc_url( $args['src'] ) ) ) {
[251] Fix | Delete
add_filter( 'oembed_dataparse', 'et_pb_video_oembed_data_parse', 10, 3 );
[252] Fix | Delete
// Save thumbnail
[253] Fix | Delete
$thumbnail_track_output = et_builder_get_oembed( esc_url( $args['src'] ), 'image', true );
[254] Fix | Delete
// Set back to normal
[255] Fix | Delete
remove_filter( 'oembed_dataparse', 'et_pb_video_oembed_data_parse', 10, 3 );
[256] Fix | Delete
return $thumbnail_track_output;
[257] Fix | Delete
} else {
[258] Fix | Delete
return '';
[259] Fix | Delete
}
[260] Fix | Delete
}
[261] Fix | Delete
}
[262] Fix | Delete
[263] Fix | Delete
static function is_oembed( $args = array(), $conditional_tags = array(), $current_page = array() ) {
[264] Fix | Delete
$defaults = array(
[265] Fix | Delete
'src',
[266] Fix | Delete
);
[267] Fix | Delete
[268] Fix | Delete
$args = wp_parse_args( $args, $defaults );
[269] Fix | Delete
[270] Fix | Delete
return et_pb_check_oembed_provider( esc_url( $args['src'] ) );
[271] Fix | Delete
}
[272] Fix | Delete
[273] Fix | Delete
static function get_oembed( $args = array(), $conditional_tags = array(), $current_page = array() ) {
[274] Fix | Delete
$defaults = array(
[275] Fix | Delete
'src' => '',
[276] Fix | Delete
);
[277] Fix | Delete
[278] Fix | Delete
$args = wp_parse_args( $args, $defaults );
[279] Fix | Delete
[280] Fix | Delete
// Save thumbnail
[281] Fix | Delete
$thumbnail_track_output = et_builder_get_oembed( esc_url( $args['src'] ), 'image', true );
[282] Fix | Delete
[283] Fix | Delete
return $thumbnail_track_output;
[284] Fix | Delete
}
[285] Fix | Delete
[286] Fix | Delete
static function get_video( $args = array(), $conditional_tags = array(), $current_page = array() ) {
[287] Fix | Delete
$defaults = array(
[288] Fix | Delete
'src' => '',
[289] Fix | Delete
'src_webm' => '',
[290] Fix | Delete
);
[291] Fix | Delete
[292] Fix | Delete
$args = wp_parse_args( $args, $defaults );
[293] Fix | Delete
[294] Fix | Delete
$video_src = '';
[295] Fix | Delete
[296] Fix | Delete
if ( false !== et_pb_check_oembed_provider( esc_url( $args['src'] ) ) ) {
[297] Fix | Delete
$video_src = et_builder_get_oembed( esc_url( $args['src'] ) );
[298] Fix | Delete
} else {
[299] Fix | Delete
$video_src = sprintf(
[300] Fix | Delete
'
[301] Fix | Delete
<video controls>
[302] Fix | Delete
%1$s
[303] Fix | Delete
%2$s
[304] Fix | Delete
</video>',
[305] Fix | Delete
( '' !== $args['src'] ? sprintf( '<source type="video/mp4" src="%1$s" />', esc_url( $args['src'] ) ) : '' ),
[306] Fix | Delete
( '' !== $args['src_webm'] ? sprintf( '<source type="video/webm" src="%1$s" />', esc_url( $args['src_webm'] ) ) : '' )
[307] Fix | Delete
);
[308] Fix | Delete
[309] Fix | Delete
wp_enqueue_style( 'wp-mediaelement' );
[310] Fix | Delete
wp_enqueue_script( 'wp-mediaelement' );
[311] Fix | Delete
}
[312] Fix | Delete
[313] Fix | Delete
return $video_src;
[314] Fix | Delete
}
[315] Fix | Delete
[316] Fix | Delete
/**
[317] Fix | Delete
* Renders the module output.
[318] Fix | Delete
*
[319] Fix | Delete
* @param array $attrs List of attributes.
[320] Fix | Delete
* @param string $content Content being processed.
[321] Fix | Delete
* @param string $render_slug Slug of module that is used for rendering output.
[322] Fix | Delete
*
[323] Fix | Delete
* @return string
[324] Fix | Delete
*/
[325] Fix | Delete
public function render( $attrs, $content, $render_slug ) {
[326] Fix | Delete
global $et_pb_slider_image_overlay,
[327] Fix | Delete
$et_pb_video_slider_sticky;
[328] Fix | Delete
[329] Fix | Delete
$multi_view = et_pb_multi_view_options( $this );
[330] Fix | Delete
$multi_view->set_custom_prop( 'show_image_overlay', $et_pb_slider_image_overlay );
[331] Fix | Delete
[332] Fix | Delete
$src = $this->props['src'];
[333] Fix | Delete
$src_webm = $this->props['src_webm'];
[334] Fix | Delete
$image_src = $this->props['image_src'];
[335] Fix | Delete
$video_src = '';
[336] Fix | Delete
[337] Fix | Delete
// Controls.
[338] Fix | Delete
$use_icon_font_size = $this->props['use_icon_font_size'];
[339] Fix | Delete
[340] Fix | Delete
// Play Icon color.
[341] Fix | Delete
$this->generate_styles(
[342] Fix | Delete
array(
[343] Fix | Delete
'base_attr_name' => 'play_icon_color',
[344] Fix | Delete
'selector' => '%%order_class%%.et_pb_slide .et_pb_video_play',
[345] Fix | Delete
'hover_pseudo_selector_location' => 'suffix',
[346] Fix | Delete
'sticky_pseudo_selector_location' => 'prefix',
[347] Fix | Delete
'css_property' => 'color',
[348] Fix | Delete
'important' => true,
[349] Fix | Delete
'render_slug' => $render_slug,
[350] Fix | Delete
'type' => 'color',
[351] Fix | Delete
)
[352] Fix | Delete
);
[353] Fix | Delete
[354] Fix | Delete
// Icon Size.
[355] Fix | Delete
if ( 'off' !== $use_icon_font_size ) {
[356] Fix | Delete
// Icon Font Size.
[357] Fix | Delete
$this->generate_styles(
[358] Fix | Delete
array(
[359] Fix | Delete
'base_attr_name' => 'icon_font_size',
[360] Fix | Delete
'selector' => '.et_pb_video_slider %%order_class%%.et_pb_slide .et_pb_video_wrap .et_pb_video_overlay .et_pb_video_play',
[361] Fix | Delete
'hover_pseudo_selector_location' => 'suffix',
[362] Fix | Delete
'sticky_pseudo_selector_location' => 'prefix',
[363] Fix | Delete
'render_slug' => $render_slug,
[364] Fix | Delete
'type' => 'range',
[365] Fix | Delete
'is_sticky_module' => $et_pb_video_slider_sticky,
[366] Fix | Delete
[367] Fix | Delete
// processed attr value can't be directly assigned to single css property so
[368] Fix | Delete
// custom processor is needed to render this attr.
[369] Fix | Delete
'processor' => array(
[370] Fix | Delete
'ET_Builder_Module_Helper_Style_Processor',
[371] Fix | Delete
'process_overlay_icon_font_size',
[372] Fix | Delete
),
[373] Fix | Delete
)
[374] Fix | Delete
);
[375] Fix | Delete
}
[376] Fix | Delete
[377] Fix | Delete
global $et_pb_slider_image_overlay;
[378] Fix | Delete
[379] Fix | Delete
$video_srcs = array();
[380] Fix | Delete
$image_srcs = array();
[381] Fix | Delete
[382] Fix | Delete
foreach ( $multi_view->get_modes() as $mode ) {
[383] Fix | Delete
$src = $multi_view->get_value( 'src', $mode );
[384] Fix | Delete
$src_webm = $multi_view->get_value( 'src_webm', $mode );
[385] Fix | Delete
$image_src = $multi_view->get_value( 'image_src', $mode );
[386] Fix | Delete
[387] Fix | Delete
if ( $src || $src_webm ) {
[388] Fix | Delete
$video_srcs[ $mode ] = self::get_video(
[389] Fix | Delete
array(
[390] Fix | Delete
'src' => $src,
[391] Fix | Delete
'src_webm' => $src_webm,
[392] Fix | Delete
)
[393] Fix | Delete
);
[394] Fix | Delete
}
[395] Fix | Delete
[396] Fix | Delete
if ( $src || $image_src ) {
[397] Fix | Delete
$image_srcs[ $mode ] = self::get_oembed_thumbnail(
[398] Fix | Delete
array(
[399] Fix | Delete
'src' => $src,
[400] Fix | Delete
'image_src' => $image_src,
[401] Fix | Delete
)
[402] Fix | Delete
);
[403] Fix | Delete
}
[404] Fix | Delete
}
[405] Fix | Delete
[406] Fix | Delete
if ( $video_srcs ) {
[407] Fix | Delete
$multi_view->set_custom_prop( 'video_srcs', $video_srcs );
[408] Fix | Delete
}
[409] Fix | Delete
[410] Fix | Delete
if ( $image_srcs ) {
[411] Fix | Delete
$multi_view->set_custom_prop( 'image_srcs', $image_srcs );
[412] Fix | Delete
}
[413] Fix | Delete
[414] Fix | Delete
$video_src = $multi_view->render_element(
[415] Fix | Delete
array(
[416] Fix | Delete
'tag' => 'div',
[417] Fix | Delete
'content' => '{{video_srcs}}',
[418] Fix | Delete
'attrs' => array(
[419] Fix | Delete
'class' => 'et_pb_video_box',
[420] Fix | Delete
),
[421] Fix | Delete
)
[422] Fix | Delete
);
[423] Fix | Delete
[424] Fix | Delete
$video_overlay = $multi_view->render_element(
[425] Fix | Delete
array(
[426] Fix | Delete
'tag' => 'div',
[427] Fix | Delete
'content' => '<div class="et_pb_video_overlay_hover"><a href="#" class="et_pb_video_play"></a></div>',
[428] Fix | Delete
'attrs' => array(
[429] Fix | Delete
'class' => 'et_pb_video_overlay',
[430] Fix | Delete
),
[431] Fix | Delete
'styles' => array(
[432] Fix | Delete
'background-image' => 'url({{image_srcs}})',
[433] Fix | Delete
),
[434] Fix | Delete
'visibility' => array(
[435] Fix | Delete
'show_image_overlay' => 'on',
[436] Fix | Delete
),
[437] Fix | Delete
)
[438] Fix | Delete
);
[439] Fix | Delete
[440] Fix | Delete
$video_output = $multi_view->render_element(
[441] Fix | Delete
array(
[442] Fix | Delete
'tag' => 'div',
[443] Fix | Delete
'content' => "{$video_src}{$video_overlay}",
[444] Fix | Delete
'attrs' => array(
[445] Fix | Delete
'class' => 'et_pb_video_wrap',
[446] Fix | Delete
),
[447] Fix | Delete
'required' => 'video_srcs',
[448] Fix | Delete
)
[449] Fix | Delete
);
[450] Fix | Delete
[451] Fix | Delete
if ( '' !== $image_src ) {
[452] Fix | Delete
$image_overlay_output = et_pb_set_video_oembed_thumbnail_resolution( $image_src, 'high' );
[453] Fix | Delete
$thumbnail_track_output = $image_src;
[454] Fix | Delete
} else {
[455] Fix | Delete
$image_overlay_output = '';
[456] Fix | Delete
if ( false !== et_pb_check_oembed_provider( esc_url( $src ) ) ) {
[457] Fix | Delete
add_filter( 'oembed_dataparse', 'et_pb_video_oembed_data_parse', 10, 3 );
[458] Fix | Delete
// Save thumbnail
[459] Fix | Delete
$thumbnail_track_output = et_builder_get_oembed( esc_url( $src ), 'image', true );
[460] Fix | Delete
$image_overlay_output = $thumbnail_track_output;
[461] Fix | Delete
// Set back to normal
[462] Fix | Delete
remove_filter( 'oembed_dataparse', 'et_pb_video_oembed_data_parse', 10, 3 );
[463] Fix | Delete
} else {
[464] Fix | Delete
$thumbnail_track_output = '';
[465] Fix | Delete
}
[466] Fix | Delete
}
[467] Fix | Delete
[468] Fix | Delete
// Module classnames
[469] Fix | Delete
$this->add_classname(
[470] Fix | Delete
array(
[471] Fix | Delete
'et_pb_slide',
[472] Fix | Delete
)
[473] Fix | Delete
);
[474] Fix | Delete
[475] Fix | Delete
// Background layout class names.
[476] Fix | Delete
$background_layout_class_names = et_pb_background_layout_options()->get_background_layout_class( $this->props );
[477] Fix | Delete
$this->add_classname( $background_layout_class_names );
[478] Fix | Delete
[479] Fix | Delete
// Remove automatically added classnames
[480] Fix | Delete
$this->remove_classname(
[481] Fix | Delete
array(
[482] Fix | Delete
'et_pb_module',
[483] Fix | Delete
$render_slug,
[484] Fix | Delete
)
[485] Fix | Delete
);
[486] Fix | Delete
[487] Fix | Delete
// Background layout data attributes.
[488] Fix | Delete
$data_background_layout = et_pb_background_layout_options()->get_background_layout_attrs( $this->props );
[489] Fix | Delete
[490] Fix | Delete
$multi_view_image_srcs_data_attr = $multi_view->render_attrs(
[491] Fix | Delete
array(
[492] Fix | Delete
'attrs' => array(
[493] Fix | Delete
'data-image' => '{{image_srcs}}',
[494] Fix | Delete
),
[495] Fix | Delete
)
[496] Fix | Delete
);
[497] Fix | Delete
[498] Fix | Delete
$output = sprintf(
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function