Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/includes/builder/module
File: VideoSlider.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class ET_Builder_Module_Video_Slider extends ET_Builder_Module {
[2] Fix | Delete
function init() {
[3] Fix | Delete
$this->name = esc_html__( 'Video Slider', 'et_builder' );
[4] Fix | Delete
$this->plural = esc_html__( 'Video Sliders', 'et_builder' );
[5] Fix | Delete
$this->slug = 'et_pb_video_slider';
[6] Fix | Delete
$this->vb_support = 'on';
[7] Fix | Delete
$this->child_slug = 'et_pb_video_slider_item';
[8] Fix | Delete
$this->child_item_text = esc_html__( 'Video', 'et_builder' );
[9] Fix | Delete
$this->main_css_element = '.et_pb_video_slider%%order_class%%';
[10] Fix | Delete
$this->has_box_shadow = false;
[11] Fix | Delete
$this->settings_modal_toggles = array(
[12] Fix | Delete
'general' => array(
[13] Fix | Delete
'toggles' => array(
[14] Fix | Delete
'elements' => et_builder_i18n( 'Elements' ),
[15] Fix | Delete
'overlay' => et_builder_i18n( 'Overlay' ),
[16] Fix | Delete
),
[17] Fix | Delete
),
[18] Fix | Delete
'advanced' => array(
[19] Fix | Delete
'toggles' => array(
[20] Fix | Delete
'colors' => esc_html__( 'Controls', 'et_builder' ),
[21] Fix | Delete
),
[22] Fix | Delete
),
[23] Fix | Delete
);
[24] Fix | Delete
[25] Fix | Delete
$this->custom_css_fields = array(
[26] Fix | Delete
'play_button' => array(
[27] Fix | Delete
'label' => esc_html__( 'Play Button', 'et_builder' ),
[28] Fix | Delete
'selector' => '.et_pb_video_play',
[29] Fix | Delete
),
[30] Fix | Delete
'thumbnail_item' => array(
[31] Fix | Delete
'label' => esc_html__( 'Thumbnail Item', 'et_builder' ),
[32] Fix | Delete
'selector' => '.et_pb_carousel_item',
[33] Fix | Delete
),
[34] Fix | Delete
'arrows' => array(
[35] Fix | Delete
'label' => esc_html__( 'Slider Arrows', 'et_builder' ),
[36] Fix | Delete
'selector' => '.et-pb-slider-arrows a',
[37] Fix | Delete
),
[38] Fix | Delete
);
[39] Fix | Delete
[40] Fix | Delete
$this->advanced_fields = array(
[41] Fix | Delete
'borders' => array(
[42] Fix | Delete
'default' => array(
[43] Fix | Delete
'css' => array(
[44] Fix | Delete
'main' => array(
[45] Fix | Delete
'border_radii' => "{$this->main_css_element} .et_pb_slider, {$this->main_css_element} .et_pb_carousel_item",
[46] Fix | Delete
'border_styles' => "{$this->main_css_element} .et_pb_slider, {$this->main_css_element} .et_pb_carousel_item",
[47] Fix | Delete
),
[48] Fix | Delete
),
[49] Fix | Delete
),
[50] Fix | Delete
),
[51] Fix | Delete
'margin_padding' => array(
[52] Fix | Delete
'css' => array(
[53] Fix | Delete
'important' => array( 'custom_margin' ), // needed to overwrite last module margin-bottom styling
[54] Fix | Delete
),
[55] Fix | Delete
),
[56] Fix | Delete
'max_width' => array(
[57] Fix | Delete
'css' => array(
[58] Fix | Delete
'module_alignment' => "%%order_class%%.et_pb_video_slider.et_pb_module",
[59] Fix | Delete
),
[60] Fix | Delete
),
[61] Fix | Delete
'fonts' => false,
[62] Fix | Delete
'text' => false,
[63] Fix | Delete
'button' => false,
[64] Fix | Delete
'box_shadow' => array(
[65] Fix | Delete
'default' => array(
[66] Fix | Delete
'css' => array(
[67] Fix | Delete
'main' => '%%order_class%%>.et_pb_slider, %%order_class%%>.et_pb_carousel .et_pb_carousel_item',
[68] Fix | Delete
'overlay' => 'inset',
[69] Fix | Delete
),
[70] Fix | Delete
),
[71] Fix | Delete
),
[72] Fix | Delete
'link_options' => false,
[73] Fix | Delete
'position_fields' => array(
[74] Fix | Delete
'default' => 'relative',
[75] Fix | Delete
),
[76] Fix | Delete
);
[77] Fix | Delete
[78] Fix | Delete
$this->help_videos = array(
[79] Fix | Delete
array(
[80] Fix | Delete
'id' => 'gwTruYDcxoE',
[81] Fix | Delete
'name' => esc_html__( 'An introduction to the Video Slider module', 'et_builder' ),
[82] Fix | Delete
),
[83] Fix | Delete
);
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
function get_fields() {
[87] Fix | Delete
$fields = array(
[88] Fix | Delete
'show_image_overlay' => array(
[89] Fix | Delete
'label' => esc_html__( 'Show Image Overlays on Main Video', 'et_builder' ),
[90] Fix | Delete
'type' => 'yes_no_button',
[91] Fix | Delete
'option_category' => 'configuration',
[92] Fix | Delete
'options' => array(
[93] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[94] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[95] Fix | Delete
),
[96] Fix | Delete
'default_on_front' => 'off',
[97] Fix | Delete
'toggle_slug' => 'overlay',
[98] Fix | Delete
'description' => esc_html__( 'This option will cover the player UI on the main video. This image can either be uploaded in each video setting or auto-generated by Divi.', 'et_builder' ),
[99] Fix | Delete
'mobile_options' => true,
[100] Fix | Delete
'hover' => 'tabs',
[101] Fix | Delete
),
[102] Fix | Delete
'show_arrows' => array(
[103] Fix | Delete
'label' => esc_html__( 'Show Arrows', 'et_builder' ),
[104] Fix | Delete
'type' => 'yes_no_button',
[105] Fix | Delete
'option_category' => 'configuration',
[106] Fix | Delete
'options' => array(
[107] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[108] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[109] Fix | Delete
),
[110] Fix | Delete
'default_on_front' => 'on',
[111] Fix | Delete
'toggle_slug' => 'elements',
[112] Fix | Delete
'description' => esc_html__( 'This setting will turn on and off the navigation arrows.', 'et_builder' ),
[113] Fix | Delete
'mobile_options' => true,
[114] Fix | Delete
'hover' => 'tabs',
[115] Fix | Delete
),
[116] Fix | Delete
'show_thumbnails' => array(
[117] Fix | Delete
'label' => esc_html__( 'Slider Controls', 'et_builder' ),
[118] Fix | Delete
'type' => 'select',
[119] Fix | Delete
'option_category' => 'configuration',
[120] Fix | Delete
'options' => array(
[121] Fix | Delete
'on' => esc_html__( 'Use Thumbnail Track', 'et_builder' ),
[122] Fix | Delete
'off' => esc_html__( 'Use Dot Navigation', 'et_builder' ),
[123] Fix | Delete
),
[124] Fix | Delete
'default_on_front' => 'on',
[125] Fix | Delete
'toggle_slug' => 'elements',
[126] Fix | Delete
'description' => esc_html__( 'This setting will let you choose to use the thumbnail track controls below the slider or dot navigation at the bottom of the slider.', 'et_builder' ),
[127] Fix | Delete
'mobile_options' => true,
[128] Fix | Delete
'hover' => 'tabs',
[129] Fix | Delete
),
[130] Fix | Delete
'play_icon_color' => array(
[131] Fix | Delete
'label' => esc_html__( 'Play Icon Color', 'et_builder' ),
[132] Fix | Delete
'description' => esc_html__( 'Here you can define a custom color for the play icon.', 'et_builder' ),
[133] Fix | Delete
'type' => 'color-alpha',
[134] Fix | Delete
'custom_color' => true,
[135] Fix | Delete
'tab_slug' => 'advanced',
[136] Fix | Delete
'toggle_slug' => 'colors',
[137] Fix | Delete
'hover' => 'tabs',
[138] Fix | Delete
'mobile_options' => true,
[139] Fix | Delete
),
[140] Fix | Delete
'use_icon_font_size' => array(
[141] Fix | Delete
'label' => esc_html__( 'Use Play Icon Font Size', 'et_builder' ),
[142] Fix | Delete
'description' => esc_html__( 'If you would like to control the size of the icon, you must first enable this option.', 'et_builder' ),
[143] Fix | Delete
'type' => 'yes_no_button',
[144] Fix | Delete
'options' => array(
[145] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[146] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[147] Fix | Delete
),
[148] Fix | Delete
'default_on_front' => 'off',
[149] Fix | Delete
'affects' => array(
[150] Fix | Delete
'icon_font_size',
[151] Fix | Delete
),
[152] Fix | Delete
'tab_slug' => 'advanced',
[153] Fix | Delete
'toggle_slug' => 'colors',
[154] Fix | Delete
'option_category' => 'font_option',
[155] Fix | Delete
),
[156] Fix | Delete
'icon_font_size' => array(
[157] Fix | Delete
'label' => esc_html__( 'Play Icon Font Size', 'et_builder' ),
[158] Fix | Delete
'description' => esc_html__( 'Control the size of the icon by increasing or decreasing the font size.', 'et_builder' ),
[159] Fix | Delete
'type' => 'range',
[160] Fix | Delete
'option_category' => 'font_option',
[161] Fix | Delete
'tab_slug' => 'advanced',
[162] Fix | Delete
'toggle_slug' => 'colors',
[163] Fix | Delete
'allowed_units' => array( '%', 'em', 'rem', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ex', 'vh', 'vw' ),
[164] Fix | Delete
'default' => '96px',
[165] Fix | Delete
'default_unit' => 'px',
[166] Fix | Delete
'default_on_front' => '',
[167] Fix | Delete
'range_settings' => array(
[168] Fix | Delete
'min' => '1',
[169] Fix | Delete
'max' => '120',
[170] Fix | Delete
'step' => '1',
[171] Fix | Delete
),
[172] Fix | Delete
'mobile_options' => true,
[173] Fix | Delete
'depends_show_if' => 'on',
[174] Fix | Delete
'responsive' => true,
[175] Fix | Delete
'hover' => 'tabs',
[176] Fix | Delete
),
[177] Fix | Delete
'thumbnail_overlay_color' => array(
[178] Fix | Delete
'label' => esc_html__( 'Thumbnail Overlay Color', 'et_builder' ),
[179] 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' ),
[180] Fix | Delete
'type' => 'color-alpha',
[181] Fix | Delete
'custom_color' => true,
[182] Fix | Delete
'tab_slug' => 'advanced',
[183] Fix | Delete
'toggle_slug' => 'colors',
[184] Fix | Delete
'mobile_options' => true,
[185] Fix | Delete
),
[186] Fix | Delete
'controls_color' => array(
[187] Fix | Delete
'label' => esc_html__( 'Slider Controls Color', 'et_builder' ),
[188] Fix | Delete
'type' => 'select',
[189] Fix | Delete
'option_category' => 'color_option',
[190] Fix | Delete
'options' => array(
[191] Fix | Delete
'light' => et_builder_i18n( 'Light' ),
[192] Fix | Delete
'dark' => et_builder_i18n( 'Dark' ),
[193] Fix | Delete
),
[194] Fix | Delete
'tab_slug' => 'advanced',
[195] Fix | Delete
'toggle_slug' => 'colors',
[196] Fix | Delete
'description' => esc_html__( 'This setting will make your slider controls either light or dark in color. Slider controls are either the arrows on the thumbnail track or the circles in dot navigation.', 'et_builder' ),
[197] Fix | Delete
),
[198] Fix | Delete
);
[199] Fix | Delete
return $fields;
[200] Fix | Delete
}
[201] Fix | Delete
[202] Fix | Delete
public function get_transition_fields_css_props() {
[203] Fix | Delete
$fields = parent::get_transition_fields_css_props();
[204] Fix | Delete
[205] Fix | Delete
$fields['play_icon_color'] = array( 'color' => '%%order_class%% .et_pb_video_play, %%order_class%% .et_pb_carousel .et_pb_video_play' );
[206] Fix | Delete
$fields['icon_font_size'] = array(
[207] Fix | Delete
'font-size' => '%%order_class%% .et_pb_video_play, %%order_class%% .et_pb_carousel .et_pb_video_play',
[208] Fix | Delete
'margin-left' => '%%order_class%% .et_pb_video_play, %%order_class%% .et_pb_carousel .et_pb_video_play',
[209] Fix | Delete
'margin-top' => '%%order_class%% .et_pb_video_play, %%order_class%% .et_pb_carousel .et_pb_video_play',
[210] Fix | Delete
'line-height' => '%%order_class%% .et_pb_video_play, %%order_class%% .et_pb_carousel .et_pb_video_play',
[211] Fix | Delete
);
[212] Fix | Delete
[213] Fix | Delete
return $fields;
[214] Fix | Delete
}
[215] Fix | Delete
[216] Fix | Delete
function before_render() {
[217] Fix | Delete
global $et_pb_slider_image_overlay;
[218] Fix | Delete
[219] Fix | Delete
$show_image_overlay = et_pb_multi_view_options( $this )->get_values( 'show_image_overlay' );
[220] Fix | Delete
[221] Fix | Delete
$et_pb_slider_image_overlay = $show_image_overlay;
[222] Fix | Delete
[223] Fix | Delete
}
[224] Fix | Delete
[225] Fix | Delete
function render( $attrs, $content = null, $render_slug ) {
[226] Fix | Delete
$multi_view = et_pb_multi_view_options( $this );
[227] Fix | Delete
$show_arrows = $this->props['show_arrows'];
[228] Fix | Delete
$show_thumbnails = $this->props['show_thumbnails'];
[229] Fix | Delete
$controls_color = $this->props['controls_color'];
[230] Fix | Delete
$use_icon_font_size = $this->props['use_icon_font_size'];
[231] Fix | Delete
$play_icon_color_values = et_pb_responsive_options()->get_property_values( $this->props, 'play_icon_color' );
[232] Fix | Delete
$play_icon_color_hover = $this->get_hover_value( 'play_icon_color' );
[233] Fix | Delete
$icon_font_size_values = et_pb_responsive_options()->get_property_values( $this->props, 'icon_font_size' );
[234] Fix | Delete
$icon_font_size_hover = $this->get_hover_value( 'icon_font_size' );
[235] Fix | Delete
$thumbnail_overlay_colors = et_pb_responsive_options()->get_property_values( $this->props, 'thumbnail_overlay_color' );
[236] Fix | Delete
[237] Fix | Delete
global $et_pb_slider_image_overlay;
[238] Fix | Delete
[239] Fix | Delete
$video_background = $this->video_background();
[240] Fix | Delete
$parallax_image_background = $this->get_parallax_image_background();
[241] Fix | Delete
[242] Fix | Delete
// Play Icon color.
[243] Fix | Delete
et_pb_responsive_options()->generate_responsive_css( $play_icon_color_values, '%%order_class%% .et_pb_video_play, %%order_class%% .et_pb_carousel .et_pb_video_play', 'color', $render_slug, ' !important;', 'color' );
[244] Fix | Delete
[245] Fix | Delete
if ( et_builder_is_hover_enabled( 'play_icon_color', $this->props ) ) {
[246] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[247] Fix | Delete
'selector' => '%%order_class%% .et_pb_video_play:hover, %%order_class%% .et_pb_carousel .et_pb_video_play:hover',
[248] Fix | Delete
'declaration' => sprintf(
[249] Fix | Delete
'color: %1$s !important;',
[250] Fix | Delete
esc_html( $play_icon_color_hover )
[251] Fix | Delete
),
[252] Fix | Delete
) );
[253] Fix | Delete
}
[254] Fix | Delete
[255] Fix | Delete
// Icon Size.
[256] Fix | Delete
$icon_selector = '%%order_class%% .et_pb_video_play, %%order_class%% .et_pb_carousel .et_pb_video_play';
[257] Fix | Delete
if ( 'off' !== $use_icon_font_size ) {
[258] Fix | Delete
// Proccess for each devices.
[259] Fix | Delete
foreach ( $icon_font_size_values as $font_size_key => $font_size_value ) {
[260] Fix | Delete
if ( '' === $font_size_value ) {
[261] Fix | Delete
continue;
[262] Fix | Delete
}
[263] Fix | Delete
[264] Fix | Delete
$media_query = 'general';
[265] Fix | Delete
if ( 'tablet' === $font_size_key ) {
[266] Fix | Delete
$media_query = ET_Builder_Element::get_media_query( 'max_width_980' );
[267] Fix | Delete
} elseif ( 'phone' === $font_size_key ) {
[268] Fix | Delete
$media_query = ET_Builder_Element::get_media_query( 'max_width_767' );
[269] Fix | Delete
}
[270] Fix | Delete
[271] Fix | Delete
$font_size_value_int = (int) $font_size_value;
[272] Fix | Delete
$font_size_value_unit = str_replace( $font_size_value_int, '', $font_size_value );
[273] Fix | Delete
$font_size_value_half = 0 < $font_size_value_int ? -1 * $font_size_value_int / 2 : 0;
[274] Fix | Delete
$font_size_value_half = (string) $font_size_value_half . $font_size_value_unit;
[275] Fix | Delete
[276] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[277] Fix | Delete
'selector' => '%%order_class%% .et_pb_video_play',
[278] Fix | Delete
'declaration' => sprintf(
[279] Fix | Delete
'font-size:%1$s; line-height:%1$s; margin-top:%2$s;',
[280] Fix | Delete
esc_html( $font_size_value ),
[281] Fix | Delete
esc_html( $font_size_value_half )
[282] Fix | Delete
),
[283] Fix | Delete
'media_query' => $media_query,
[284] Fix | Delete
) );
[285] Fix | Delete
[286] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[287] Fix | Delete
'selector' => '%%order_class%% .et_pb_video_wrap .et_pb_video_overlay .et_pb_video_play',
[288] Fix | Delete
'declaration' => sprintf(
[289] Fix | Delete
'margin-left:%1$s;',
[290] Fix | Delete
esc_html( $font_size_value_half )
[291] Fix | Delete
),
[292] Fix | Delete
'media_query' => $media_query,
[293] Fix | Delete
) );
[294] Fix | Delete
}
[295] Fix | Delete
[296] Fix | Delete
// Icon hover styles.
[297] Fix | Delete
if ( et_builder_is_hover_enabled( 'icon_font_size', $this->props ) && '' !== $icon_font_size_hover ) {
[298] Fix | Delete
$icon_font_size_hover_int = (int) $icon_font_size_hover;
[299] Fix | Delete
$icon_font_size_hover_unit = str_replace( $icon_font_size_hover_int, '', $icon_font_size_hover );
[300] Fix | Delete
$icon_font_size_hover_half = 0 < $icon_font_size_hover_int ? $icon_font_size_hover_int / 2 : 0;
[301] Fix | Delete
$icon_font_size_hover_half = (string) $icon_font_size_hover_half . $icon_font_size_hover_unit;
[302] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[303] Fix | Delete
'selector' => $this->add_hover_to_selectors( $icon_selector ),
[304] Fix | Delete
'declaration' => sprintf(
[305] Fix | Delete
'font-size:%1$s; line-height:%1$s; margin-top:-%2$s; margin-left:-%2$s;',
[306] Fix | Delete
esc_html( $icon_font_size_hover ),
[307] Fix | Delete
esc_html( $icon_font_size_hover_half )
[308] Fix | Delete
),
[309] Fix | Delete
) );
[310] Fix | Delete
}
[311] Fix | Delete
}
[312] Fix | Delete
[313] Fix | Delete
// Thumbnail Overlay Color.
[314] Fix | Delete
et_pb_responsive_options()->generate_responsive_css( $thumbnail_overlay_colors, '%%order_class%% .et_pb_carousel_item .et_pb_video_overlay_hover:hover, %%order_class%%.et_pb_video_slider .et_pb_slider:hover .et_pb_video_overlay_hover, %%order_class%% .et_pb_carousel_item.et-pb-active-control .et_pb_video_overlay_hover', 'background-color', $render_slug, '', 'color' );
[315] Fix | Delete
[316] Fix | Delete
$slider_classname = '';
[317] Fix | Delete
$slider_classname .= 'off' === $show_arrows ? ' et_pb_slider_no_arrows' : '';
[318] Fix | Delete
$slider_classname .= 'on' === $show_thumbnails ? ' et_pb_slider_carousel et_pb_slider_no_pagination' : '';
[319] Fix | Delete
$slider_classname .= 'off' === $show_thumbnails ? ' et_pb_slider_dots' : '';
[320] Fix | Delete
$slider_classname .= " et_pb_controls_{$controls_color}";
[321] Fix | Delete
[322] Fix | Delete
$content = $this->content;
[323] Fix | Delete
[324] Fix | Delete
// Module classnames
[325] Fix | Delete
if ( $this->has_box_shadow ) {
[326] Fix | Delete
$this->add_classname( 'et_pb_has_box_shadow' );
[327] Fix | Delete
}
[328] Fix | Delete
[329] Fix | Delete
$multi_view_data_attr = $multi_view->render_attrs( array(
[330] Fix | Delete
'classes' => array(
[331] Fix | Delete
'et_pb_slider_no_arrows' => array(
[332] Fix | Delete
'show_arrows' => 'off',
[333] Fix | Delete
),
[334] Fix | Delete
'et_pb_slider_carousel' => array(
[335] Fix | Delete
'show_thumbnails' => 'on',
[336] Fix | Delete
),
[337] Fix | Delete
'et_pb_slider_no_pagination' => array(
[338] Fix | Delete
'show_thumbnails' => 'on',
[339] Fix | Delete
),
[340] Fix | Delete
'et_pb_slider_dots' => array(
[341] Fix | Delete
'show_thumbnails' => 'off',
[342] Fix | Delete
),
[343] Fix | Delete
),
[344] Fix | Delete
) );
[345] Fix | Delete
[346] Fix | Delete
$output = sprintf(
[347] Fix | Delete
'<div%3$s class="%4$s">
[348] Fix | Delete
%6$s
[349] Fix | Delete
%5$s
[350] Fix | Delete
<div class="et_pb_slider et_pb_preload%1$s"%7$s>
[351] Fix | Delete
<div class="et_pb_slides">
[352] Fix | Delete
%2$s
[353] Fix | Delete
</div> <!-- .et_pb_slides -->
[354] Fix | Delete
</div> <!-- .et_pb_slider -->
[355] Fix | Delete
</div> <!-- .et_pb_video_slider -->
[356] Fix | Delete
',
[357] Fix | Delete
esc_attr( $slider_classname ),
[358] Fix | Delete
$content,
[359] Fix | Delete
$this->module_id(),
[360] Fix | Delete
$this->module_classname( $render_slug ),
[361] Fix | Delete
$video_background,
[362] Fix | Delete
$parallax_image_background,
[363] Fix | Delete
$multi_view_data_attr
[364] Fix | Delete
);
[365] Fix | Delete
[366] Fix | Delete
return $output;
[367] Fix | Delete
}
[368] Fix | Delete
}
[369] Fix | Delete
[370] Fix | Delete
new ET_Builder_Module_Video_Slider;
[371] Fix | Delete
[372] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function