Edit File by line
/home/barbar84/www/wp-conte.../themes/Divi/includes/builder/module
File: Video.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class ET_Builder_Module_Video 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';
[6] Fix | Delete
$this->vb_support = 'on';
[7] Fix | Delete
[8] Fix | Delete
$this->settings_modal_toggles = array(
[9] Fix | Delete
'general' => array(
[10] Fix | Delete
'toggles' => array(
[11] Fix | Delete
'main_content' => esc_html__( 'Video', 'et_builder' ),
[12] Fix | Delete
'overlay' => et_builder_i18n( 'Overlay' ),
[13] Fix | Delete
),
[14] Fix | Delete
),
[15] Fix | Delete
'advanced' => array(
[16] Fix | Delete
'toggles' => array(
[17] Fix | Delete
'play_icon' => esc_html__( 'Play Icon', 'et_builder' ),
[18] Fix | Delete
'overlay' => et_builder_i18n( 'Overlay' ),
[19] Fix | Delete
),
[20] Fix | Delete
),
[21] Fix | Delete
);
[22] Fix | Delete
[23] Fix | Delete
$this->custom_css_fields = array(
[24] Fix | Delete
'video_icon' => array(
[25] Fix | Delete
'label' => esc_html__( 'Video Icon', 'et_builder' ),
[26] Fix | Delete
'selector' => '.et_pb_video_play',
[27] Fix | Delete
),
[28] Fix | Delete
);
[29] Fix | Delete
[30] Fix | Delete
$this->advanced_fields = array(
[31] Fix | Delete
'background' => array(
[32] Fix | Delete
'options' => array(
[33] Fix | Delete
'background_color' => array(
[34] Fix | Delete
'depends_on' => array(
[35] Fix | Delete
'custom_padding',
[36] Fix | Delete
),
[37] Fix | Delete
'depends_on_responsive' => array(
[38] Fix | Delete
'custom_padding',
[39] Fix | Delete
),
[40] Fix | Delete
'depends_show_if_not' => array(
[41] Fix | Delete
'',
[42] Fix | Delete
'|||',
[43] Fix | Delete
),
[44] Fix | Delete
'is_toggleable' => true,
[45] Fix | Delete
),
[46] Fix | Delete
),
[47] Fix | Delete
),
[48] Fix | Delete
'borders' => array(
[49] Fix | Delete
'default' => array(
[50] Fix | Delete
'css' => array(
[51] Fix | Delete
'main' => array(
[52] Fix | Delete
'border_radii' => '%%order_class%%, %%order_class%% iframe',
[53] Fix | Delete
),
[54] Fix | Delete
),
[55] Fix | Delete
),
[56] Fix | Delete
),
[57] Fix | Delete
'box_shadow' => array(
[58] Fix | Delete
'default' => array(
[59] Fix | Delete
'css' => array(
[60] Fix | Delete
'overlay' => 'inset',
[61] Fix | Delete
),
[62] Fix | Delete
),
[63] Fix | Delete
),
[64] Fix | Delete
'margin_padding' => array(
[65] Fix | Delete
'css' => array(
[66] Fix | Delete
'important' => array( 'custom_margin' ), // needed to overwrite last module margin-bottom styling
[67] Fix | Delete
),
[68] Fix | Delete
'custom_padding' => array(
[69] Fix | Delete
'responsive_affects' => array(
[70] Fix | Delete
'background_color',
[71] Fix | Delete
),
[72] Fix | Delete
),
[73] Fix | Delete
),
[74] Fix | Delete
'fonts' => false,
[75] Fix | Delete
'text' => false,
[76] Fix | Delete
'button' => false,
[77] Fix | Delete
'link_options' => false,
[78] Fix | Delete
'position_fields' => array(
[79] Fix | Delete
'default' => 'relative',
[80] Fix | Delete
),
[81] Fix | Delete
);
[82] Fix | Delete
[83] Fix | Delete
$this->help_videos = array(
[84] Fix | Delete
array(
[85] Fix | Delete
'id' => '3jXN8CBz0TU',
[86] Fix | Delete
'name' => esc_html__( 'An introduction to the Video module', 'et_builder' ),
[87] Fix | Delete
),
[88] Fix | Delete
);
[89] Fix | Delete
}
[90] Fix | Delete
[91] Fix | Delete
function get_fields() {
[92] Fix | Delete
$fields = array(
[93] Fix | Delete
'src' => array(
[94] Fix | Delete
'label' => esc_html__( 'Video MP4 File Or Youtube URL', 'et_builder' ),
[95] Fix | Delete
'type' => 'upload',
[96] Fix | Delete
'option_category' => 'basic_option',
[97] Fix | Delete
'data_type' => 'video',
[98] Fix | Delete
'upload_button_text' => esc_attr__( 'Upload a video', 'et_builder' ),
[99] Fix | Delete
'choose_text' => esc_attr__( 'Choose a Video MP4 File', 'et_builder' ),
[100] Fix | Delete
'update_text' => esc_attr__( 'Set As Video', 'et_builder' ),
[101] 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' ),
[102] Fix | Delete
'toggle_slug' => 'main_content',
[103] Fix | Delete
'computed_affects' => array(
[104] Fix | Delete
'__video',
[105] Fix | Delete
),
[106] Fix | Delete
'mobile_options' => true,
[107] Fix | Delete
'hover' => 'tabs',
[108] Fix | Delete
),
[109] Fix | Delete
'src_webm' => array(
[110] Fix | Delete
'label' => esc_html__( 'Video WEBM File', 'et_builder' ),
[111] Fix | Delete
'type' => 'upload',
[112] Fix | Delete
'option_category' => 'basic_option',
[113] Fix | Delete
'data_type' => 'video',
[114] Fix | Delete
'upload_button_text' => esc_attr__( 'Upload a video', 'et_builder' ),
[115] Fix | Delete
'choose_text' => esc_attr__( 'Choose a Video WEBM File', 'et_builder' ),
[116] Fix | Delete
'update_text' => esc_attr__( 'Set As Video', 'et_builder' ),
[117] 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' ),
[118] Fix | Delete
'toggle_slug' => 'main_content',
[119] Fix | Delete
'computed_affects' => array(
[120] Fix | Delete
'__video',
[121] Fix | Delete
),
[122] Fix | Delete
'mobile_options' => true,
[123] Fix | Delete
'hover' => 'tabs',
[124] Fix | Delete
),
[125] Fix | Delete
'image_src' => array(
[126] Fix | Delete
'label' => esc_html__( 'Overlay Image', 'et_builder' ),
[127] Fix | Delete
'type' => 'upload',
[128] Fix | Delete
'option_category' => 'basic_option',
[129] Fix | Delete
'upload_button_text' => et_builder_i18n( 'Upload an image' ),
[130] Fix | Delete
'choose_text' => esc_attr__( 'Choose an Image', 'et_builder' ),
[131] Fix | Delete
'update_text' => esc_attr__( 'Set As Image', 'et_builder' ),
[132] Fix | Delete
'additional_button' => sprintf(
[133] Fix | Delete
'<input type="button" class="button et-pb-video-image-button" value="%1$s" />',
[134] Fix | Delete
esc_attr__( 'Generate Image From Video', 'et_builder' )
[135] Fix | Delete
),
[136] Fix | Delete
'additional_button_type' => 'generate_image_url_from_video',
[137] Fix | Delete
'additional_button_attrs' => array(
[138] Fix | Delete
'video_source' => 'src',
[139] Fix | Delete
),
[140] Fix | Delete
'classes' => 'et_pb_video_overlay',
[141] 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' ),
[142] Fix | Delete
'toggle_slug' => 'overlay',
[143] Fix | Delete
'computed_affects' => array(
[144] Fix | Delete
'__video_cover_src',
[145] Fix | Delete
),
[146] Fix | Delete
'dynamic_content' => 'image',
[147] Fix | Delete
'mobile_options' => true,
[148] Fix | Delete
'hover' => 'tabs',
[149] Fix | Delete
),
[150] Fix | Delete
'play_icon_color' => array(
[151] Fix | Delete
'label' => esc_html__( 'Play Icon Color', 'et_builder' ),
[152] Fix | Delete
'description' => esc_html__( 'Here you can define a custom color for the play icon.', 'et_builder' ),
[153] Fix | Delete
'type' => 'color-alpha',
[154] Fix | Delete
'custom_color' => true,
[155] Fix | Delete
'tab_slug' => 'advanced',
[156] Fix | Delete
'toggle_slug' => 'play_icon',
[157] Fix | Delete
'hover' => 'tabs',
[158] Fix | Delete
'mobile_options' => true,
[159] Fix | Delete
'sticky' => true,
[160] Fix | Delete
),
[161] Fix | Delete
'__video' => array(
[162] Fix | Delete
'type' => 'computed',
[163] Fix | Delete
'computed_callback' => array( 'ET_Builder_Module_Video', 'get_video' ),
[164] Fix | Delete
'computed_depends_on' => array(
[165] Fix | Delete
'src',
[166] Fix | Delete
'src_webm',
[167] Fix | Delete
),
[168] Fix | Delete
'computed_minimum' => array(
[169] Fix | Delete
'src',
[170] Fix | Delete
'src_webm',
[171] Fix | Delete
),
[172] Fix | Delete
),
[173] Fix | Delete
'__video_cover_src' => array(
[174] Fix | Delete
'type' => 'computed',
[175] Fix | Delete
'computed_callback' => array( 'ET_Builder_Module_Video', 'get_video_cover_src' ),
[176] Fix | Delete
'computed_depends_on' => array(
[177] Fix | Delete
'image_src',
[178] Fix | Delete
),
[179] Fix | Delete
'computed_minimum' => array(
[180] Fix | Delete
'image_src',
[181] Fix | Delete
),
[182] Fix | Delete
),
[183] Fix | Delete
'use_icon_font_size' => array(
[184] Fix | Delete
'label' => esc_html__( 'Use Custom Icon Size', 'et_builder' ),
[185] Fix | Delete
'description' => esc_html__( 'If you would like to control the size of the icon, you must first enable this option.', 'et_builder' ),
[186] Fix | Delete
'type' => 'yes_no_button',
[187] Fix | Delete
'options' => array(
[188] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[189] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[190] Fix | Delete
),
[191] Fix | Delete
'default_on_front' => 'off',
[192] Fix | Delete
'affects' => array(
[193] Fix | Delete
'icon_font_size',
[194] Fix | Delete
),
[195] Fix | Delete
'tab_slug' => 'advanced',
[196] Fix | Delete
'toggle_slug' => 'play_icon',
[197] Fix | Delete
'option_category' => 'font_option',
[198] Fix | Delete
),
[199] Fix | Delete
'icon_font_size' => array(
[200] Fix | Delete
'label' => esc_html__( 'Play Icon Font Size', 'et_builder' ),
[201] Fix | Delete
'description' => esc_html__( 'Control the size of the icon by increasing or decreasing the font size.', 'et_builder' ),
[202] Fix | Delete
'type' => 'range',
[203] Fix | Delete
'option_category' => 'font_option',
[204] Fix | Delete
'tab_slug' => 'advanced',
[205] Fix | Delete
'toggle_slug' => 'play_icon',
[206] Fix | Delete
'allowed_units' => array( '%', 'em', 'rem', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ex', 'vh', 'vw' ),
[207] Fix | Delete
'default' => '96px',
[208] Fix | Delete
'default_unit' => 'px',
[209] Fix | Delete
'default_on_front' => '',
[210] Fix | Delete
'range_settings' => array(
[211] Fix | Delete
'min' => '1',
[212] Fix | Delete
'max' => '120',
[213] Fix | Delete
'step' => '1',
[214] Fix | Delete
),
[215] Fix | Delete
'mobile_options' => true,
[216] Fix | Delete
'depends_show_if' => 'on',
[217] Fix | Delete
'responsive' => true,
[218] Fix | Delete
'sticky' => true,
[219] Fix | Delete
'hover' => 'tabs',
[220] Fix | Delete
),
[221] Fix | Delete
'thumbnail_overlay_color' => array(
[222] Fix | Delete
'label' => esc_html__( 'Overlay Background Color', 'et_builder' ),
[223] Fix | Delete
'description' => esc_html__( 'Pick a color to use for the overlay that appears behind the play icon when hovering over the video.', 'et_builder' ),
[224] Fix | Delete
'type' => 'color-alpha',
[225] Fix | Delete
'custom_color' => true,
[226] Fix | Delete
'tab_slug' => 'advanced',
[227] Fix | Delete
'toggle_slug' => 'overlay',
[228] Fix | Delete
'default_on_front' => 'rgba(0,0,0,.6)',
[229] Fix | Delete
'mobile_options' => true,
[230] Fix | Delete
'sticky' => true,
[231] Fix | Delete
),
[232] Fix | Delete
[233] Fix | Delete
);
[234] Fix | Delete
return $fields;
[235] Fix | Delete
}
[236] Fix | Delete
[237] Fix | Delete
public function get_transition_fields_css_props() {
[238] Fix | Delete
$fields = parent::get_transition_fields_css_props();
[239] Fix | Delete
[240] Fix | Delete
$fields['play_icon_color'] = array( 'color' => '%%order_class%% .et_pb_video_overlay .et_pb_video_play' );
[241] Fix | Delete
$fields['icon_font_size'] = array(
[242] Fix | Delete
'font-size' => '%%order_class%% .et_pb_video_overlay .et_pb_video_play',
[243] Fix | Delete
'line-height' => '%%order_class%% .et_pb_video_overlay .et_pb_video_play',
[244] Fix | Delete
'margin-top' => '%%order_class%% .et_pb_video_overlay .et_pb_video_play',
[245] Fix | Delete
'margin-left' => '%%order_class%% .et_pb_video_overlay .et_pb_video_play',
[246] Fix | Delete
);
[247] Fix | Delete
[248] Fix | Delete
return $fields;
[249] Fix | Delete
}
[250] Fix | Delete
[251] Fix | Delete
static function get_video( $args = array(), $conditional_tags = array(), $current_page = array() ) {
[252] Fix | Delete
$defaults = array(
[253] Fix | Delete
'src' => '',
[254] Fix | Delete
'src_webm' => '',
[255] Fix | Delete
);
[256] Fix | Delete
[257] Fix | Delete
$args = wp_parse_args( $args, $defaults );
[258] Fix | Delete
[259] Fix | Delete
if ( empty( $args['src'] ) && empty( $args['src_webm'] ) ) {
[260] Fix | Delete
return '';
[261] Fix | Delete
}
[262] Fix | Delete
[263] Fix | Delete
$video_src = '';
[264] Fix | Delete
[265] Fix | Delete
if ( false !== et_pb_check_oembed_provider( esc_url( $args['src'] ) ) ) {
[266] Fix | Delete
$video_src = et_builder_get_oembed( esc_url( $args['src'] ) );
[267] Fix | Delete
} else {
[268] Fix | Delete
$video_src = sprintf(
[269] Fix | Delete
'
[270] Fix | Delete
<video controls>
[271] Fix | Delete
%1$s
[272] Fix | Delete
%2$s
[273] Fix | Delete
</video>',
[274] Fix | Delete
( '' !== $args['src'] ? sprintf( '<source type="video/mp4" src="%s" />', esc_url( $args['src'] ) ) : '' ),
[275] Fix | Delete
( '' !== $args['src_webm'] ? sprintf( '<source type="video/webm" src="%s" />', esc_url( $args['src_webm'] ) ) : '' )
[276] Fix | Delete
);
[277] Fix | Delete
[278] Fix | Delete
wp_enqueue_style( 'wp-mediaelement' );
[279] Fix | Delete
wp_enqueue_script( 'wp-mediaelement' );
[280] Fix | Delete
}
[281] Fix | Delete
[282] Fix | Delete
return $video_src;
[283] Fix | Delete
}
[284] Fix | Delete
[285] Fix | Delete
static function get_video_cover_src( $args = array(), $conditional_tags = array(), $current_page = array() ) {
[286] Fix | Delete
$post_id = isset( $current_page['id'] ) ? $current_page['id'] : self::get_current_post_id();
[287] Fix | Delete
$defaults = array(
[288] Fix | Delete
'image_src' => '',
[289] Fix | Delete
);
[290] Fix | Delete
[291] Fix | Delete
$args = wp_parse_args( $args, $defaults );
[292] Fix | Delete
[293] Fix | Delete
if ( isset( $args['image_src'] ) ) {
[294] Fix | Delete
$dynamic_value = et_builder_parse_dynamic_content( stripslashes( $args['image_src'] ) );
[295] Fix | Delete
if ( $dynamic_value->is_dynamic() && current_user_can( 'edit_post', $post_id ) ) {
[296] Fix | Delete
$args['image_src'] = $dynamic_value->resolve( $post_id );
[297] Fix | Delete
}
[298] Fix | Delete
}
[299] Fix | Delete
[300] Fix | Delete
$image_output = '';
[301] Fix | Delete
[302] Fix | Delete
if ( '' !== $args['image_src'] ) {
[303] Fix | Delete
$image_output = et_pb_set_video_oembed_thumbnail_resolution( $args['image_src'], 'high' );
[304] Fix | Delete
}
[305] Fix | Delete
[306] Fix | Delete
return $image_output;
[307] Fix | Delete
}
[308] Fix | Delete
[309] Fix | Delete
/**
[310] Fix | Delete
* Renders the module output.
[311] Fix | Delete
*
[312] Fix | Delete
* @param array $attrs List of attributes.
[313] Fix | Delete
* @param string $content Content being processed.
[314] Fix | Delete
* @param string $render_slug Slug of module that is used for rendering output.
[315] Fix | Delete
*
[316] Fix | Delete
* @return string
[317] Fix | Delete
*/
[318] Fix | Delete
public function render( $attrs, $content, $render_slug ) {
[319] Fix | Delete
$multi_view = et_pb_multi_view_options( $this );
[320] Fix | Delete
$src = $this->props['src'];
[321] Fix | Delete
$src_webm = $this->props['src_webm'];
[322] Fix | Delete
$image_src = $this->props['image_src'];
[323] Fix | Delete
$use_icon_font_size = $this->props['use_icon_font_size'];
[324] Fix | Delete
[325] Fix | Delete
foreach ( $multi_view->get_modes() as $mode ) {
[326] Fix | Delete
$video_srcs[ $mode ] = self::get_video(
[327] Fix | Delete
array(
[328] Fix | Delete
'src' => $multi_view->get_inherit_value( 'src', $mode ),
[329] Fix | Delete
'src_webm' => $multi_view->get_inherit_value( 'src_webm', $mode ),
[330] Fix | Delete
)
[331] Fix | Delete
);
[332] Fix | Delete
}
[333] Fix | Delete
[334] Fix | Delete
$multi_view->set_custom_prop( 'video_srcs', $video_srcs );
[335] Fix | Delete
$video_src = $multi_view->render_element(
[336] Fix | Delete
array(
[337] Fix | Delete
'tag' => 'div',
[338] Fix | Delete
'content' => '{{video_srcs}}',
[339] Fix | Delete
'attrs' => array(
[340] Fix | Delete
'class' => 'et_pb_video_box',
[341] Fix | Delete
),
[342] Fix | Delete
)
[343] Fix | Delete
);
[344] Fix | Delete
[345] Fix | Delete
$video_background = $this->video_background();
[346] Fix | Delete
$parallax_image_background = $this->get_parallax_image_background();
[347] Fix | Delete
[348] Fix | Delete
// Play Icon color.
[349] Fix | Delete
$this->generate_styles(
[350] Fix | Delete
array(
[351] Fix | Delete
'base_attr_name' => 'play_icon_color',
[352] Fix | Delete
'selector' => '%%order_class%% .et_pb_video_overlay .et_pb_video_play',
[353] Fix | Delete
'hover_pseudo_selector_location' => 'suffix',
[354] Fix | Delete
'sticky_pseudo_selector_location' => 'prefix',
[355] Fix | Delete
'css_property' => 'color',
[356] Fix | Delete
'render_slug' => $render_slug,
[357] Fix | Delete
'type' => 'color',
[358] Fix | Delete
)
[359] Fix | Delete
);
[360] Fix | Delete
[361] Fix | Delete
// Icon Size.
[362] Fix | Delete
if ( 'off' !== $use_icon_font_size ) {
[363] Fix | Delete
// Icon Font Size.
[364] Fix | Delete
$this->generate_styles(
[365] Fix | Delete
array(
[366] Fix | Delete
'base_attr_name' => 'icon_font_size',
[367] Fix | Delete
'selector' => '%%order_class%% .et_pb_video_overlay .et_pb_video_play',
[368] Fix | Delete
'hover_pseudo_selector_location' => 'suffix',
[369] Fix | Delete
'sticky_pseudo_selector_location' => 'prefix',
[370] Fix | Delete
'render_slug' => $render_slug,
[371] Fix | Delete
'type' => 'range',
[372] Fix | Delete
[373] Fix | Delete
// processed attr value can't be directly assigned to single css property so
[374] Fix | Delete
// custom processor is needed to render this attr.
[375] Fix | Delete
'processor' => array(
[376] Fix | Delete
'ET_Builder_Module_Helper_Style_Processor',
[377] Fix | Delete
'process_overlay_icon_font_size',
[378] Fix | Delete
),
[379] Fix | Delete
)
[380] Fix | Delete
);
[381] Fix | Delete
}
[382] Fix | Delete
[383] Fix | Delete
// Thumbnail Overlay Color.
[384] Fix | Delete
$this->generate_styles(
[385] Fix | Delete
array(
[386] Fix | Delete
'hover' => 'false',
[387] Fix | Delete
'base_attr_name' => 'thumbnail_overlay_color',
[388] Fix | Delete
'selector' => '%%order_class%% .et_pb_video_overlay_hover:hover',
[389] Fix | Delete
'hover_pseudo_selector_location' => 'suffix',
[390] Fix | Delete
'sticky_pseudo_selector_location' => 'prefix',
[391] Fix | Delete
'css_property' => 'background-color',
[392] Fix | Delete
'render_slug' => $render_slug,
[393] Fix | Delete
'type' => 'color',
[394] Fix | Delete
)
[395] Fix | Delete
);
[396] Fix | Delete
[397] Fix | Delete
$muti_view_video_overlay = $multi_view->render_element(
[398] Fix | Delete
array(
[399] Fix | Delete
'tag' => 'div',
[400] Fix | Delete
'content' => '<div class="et_pb_video_overlay_hover"><a href="#" class="et_pb_video_play"></a></div>',
[401] Fix | Delete
'attrs' => array(
[402] Fix | Delete
'class' => 'et_pb_video_overlay',
[403] Fix | Delete
),
[404] Fix | Delete
'styles' => array(
[405] Fix | Delete
'background-image' => 'url({{image_src}})',
[406] Fix | Delete
),
[407] Fix | Delete
'visibility' => array(
[408] Fix | Delete
'image_src' => '__not_empty',
[409] Fix | Delete
),
[410] Fix | Delete
'required' => 'image_src',
[411] Fix | Delete
)
[412] Fix | Delete
);
[413] Fix | Delete
[414] Fix | Delete
$output = sprintf(
[415] Fix | Delete
'<div%2$s class="%3$s">
[416] Fix | Delete
%6$s
[417] Fix | Delete
%5$s
[418] Fix | Delete
%1$s
[419] Fix | Delete
%4$s
[420] Fix | Delete
</div>',
[421] Fix | Delete
( '' !== $video_src ? $video_src : '' ),
[422] Fix | Delete
$this->module_id(),
[423] Fix | Delete
$this->module_classname( $render_slug ),
[424] Fix | Delete
$muti_view_video_overlay,
[425] Fix | Delete
$video_background,
[426] Fix | Delete
$parallax_image_background
[427] Fix | Delete
);
[428] Fix | Delete
[429] Fix | Delete
return $output;
[430] Fix | Delete
}
[431] Fix | Delete
[432] Fix | Delete
/**
[433] Fix | Delete
* Filter multi view value.
[434] Fix | Delete
*
[435] Fix | Delete
* @since 3.27.1
[436] Fix | Delete
*
[437] Fix | Delete
* @see ET_Builder_Module_Helper_MultiViewOptions::filter_value
[438] Fix | Delete
*
[439] Fix | Delete
* @param mixed $raw_value Props raw value.
[440] Fix | Delete
* @param array $args {
[441] Fix | Delete
* Context data.
[442] Fix | Delete
*
[443] Fix | Delete
* @type string $context Context param: content, attrs, visibility, classes.
[444] Fix | Delete
* @type string $name Module options props name.
[445] Fix | Delete
* @type string $mode Current data mode: desktop, hover, tablet, phone.
[446] Fix | Delete
* @type string $attr_key Attribute key for attrs context data. Example: src, class, etc.
[447] Fix | Delete
* @type string $attr_sub_key Attribute sub key that availabe when passing attrs value as array such as styes. Example: padding-top, margin-botton, etc.
[448] Fix | Delete
* }
[449] Fix | Delete
*
[450] Fix | Delete
* @return mixed
[451] Fix | Delete
*/
[452] Fix | Delete
public function multi_view_filter_value( $raw_value, $args ) {
[453] Fix | Delete
$name = isset( $args['name'] ) ? $args['name'] : '';
[454] Fix | Delete
[455] Fix | Delete
if ( $raw_value && 'image_src' === $name ) {
[456] Fix | Delete
$raw_value = self::get_video_cover_src(
[457] Fix | Delete
array(
[458] Fix | Delete
'image_src' => $raw_value,
[459] Fix | Delete
)
[460] Fix | Delete
);
[461] Fix | Delete
}
[462] Fix | Delete
[463] Fix | Delete
return $raw_value;
[464] Fix | Delete
}
[465] Fix | Delete
}
[466] Fix | Delete
[467] Fix | Delete
new ET_Builder_Module_Video();
[468] Fix | Delete
[469] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function