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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/includes/builder
File: class-et-builder-element.php
%6$s
[14000] Fix | Delete
%7$s
[14001] Fix | Delete
%8$s
[14002] Fix | Delete
%9$s',
[14003] Fix | Delete
'' !== $current_text_size ? sprintf( 'font-size:%1$s !important;', $current_text_size ) : '',
[14004] Fix | Delete
'' !== $current_letter_spacing ? sprintf( 'letter-spacing:%1$s;', $current_letter_spacing ) : '',
[14005] Fix | Delete
'' !== $current_text_color ? sprintf( 'color:%1$s !important;', $current_text_color ) : '',
[14006] Fix | Delete
'' !== $current_border_width ? sprintf( 'border-width:%1$s !important;', $current_border_width ) : '',
[14007] Fix | Delete
'' !== $current_border_color ? sprintf( 'border-color:%1$s;', $current_border_color ) : '', // #5
[14008] Fix | Delete
'' !== $current_border_radius ? sprintf( 'border-radius:%1$s;', $current_border_radius ) : '',
[14009] Fix | Delete
'' !== $current_font ? et_builder_set_element_font( $current_font, true ) : '',
[14010] Fix | Delete
'' !== $responsive_padding_right ?
[14011] Fix | Delete
sprintf( 'padding-right: %1$s%2$s;',
[14012] Fix | Delete
$responsive_padding_right,
[14013] Fix | Delete
$main_element_styles_padding_important ? ' !important' : ''
[14014] Fix | Delete
)
[14015] Fix | Delete
: '',
[14016] Fix | Delete
'' !== $responsive_padding_left ?
[14017] Fix | Delete
sprintf( 'padding-left: %1$s%2$s;',
[14018] Fix | Delete
$responsive_padding_left,
[14019] Fix | Delete
$main_element_styles_padding_important ? ' !important' : ''
[14020] Fix | Delete
)
[14021] Fix | Delete
: ''
[14022] Fix | Delete
) );
[14023] Fix | Delete
[14024] Fix | Delete
if ( ! empty( $responsive_button_declaration ) ) {
[14025] Fix | Delete
self::set_style( $function_name, array(
[14026] Fix | Delete
'selector' => $css_element_processed,
[14027] Fix | Delete
'declaration' => $responsive_button_declaration,
[14028] Fix | Delete
'media_query' => ET_Builder_Element::get_media_query( $current_media_query ),
[14029] Fix | Delete
) );
[14030] Fix | Delete
}
[14031] Fix | Delete
[14032] Fix | Delete
// Responsive button hover declaration.
[14033] Fix | Delete
$responsive_button_hover_declaration = trim( sprintf(
[14034] Fix | Delete
'%1$s
[14035] Fix | Delete
%2$s',
[14036] Fix | Delete
'' !== $responsive_hover_padding_right ?
[14037] Fix | Delete
sprintf( 'padding-right: %1$s%2$s;',
[14038] Fix | Delete
$responsive_hover_padding_right,
[14039] Fix | Delete
$main_element_styles_padding_important ? ' !important' : ''
[14040] Fix | Delete
)
[14041] Fix | Delete
: '',
[14042] Fix | Delete
'' !== $responsive_hover_padding_left ?
[14043] Fix | Delete
sprintf( 'padding-left: %1$s%2$s;',
[14044] Fix | Delete
$responsive_hover_padding_left,
[14045] Fix | Delete
$main_element_styles_padding_important ? ' !important' : ''
[14046] Fix | Delete
)
[14047] Fix | Delete
: ''
[14048] Fix | Delete
) );
[14049] Fix | Delete
[14050] Fix | Delete
// Responsive button hover styles.
[14051] Fix | Delete
if ( ! empty( $responsive_button_hover_declaration ) ) {
[14052] Fix | Delete
self::set_style( $function_name, array(
[14053] Fix | Delete
'selector' => $css_element_processed . ':hover',
[14054] Fix | Delete
'declaration' => $responsive_button_hover_declaration,
[14055] Fix | Delete
'media_query' => ET_Builder_Element::get_media_query( $current_media_query ),
[14056] Fix | Delete
) );
[14057] Fix | Delete
}
[14058] Fix | Delete
[14059] Fix | Delete
// Responsive button after styles.
[14060] Fix | Delete
if ( 'off' !== $button_use_icon ) {
[14061] Fix | Delete
// Button Icon Code.
[14062] Fix | Delete
$current_icon_code = '' !== $current_icon ? str_replace( ';', '', str_replace( '&#x', '', html_entity_decode( et_pb_process_font_icon( $current_icon ) ) ) ) : '';
[14063] Fix | Delete
[14064] Fix | Delete
// 1. Set button color, line-height, font-size, and icon placement.
[14065] Fix | Delete
$responsive_button_after_declaration = trim( sprintf(
[14066] Fix | Delete
'%1$s
[14067] Fix | Delete
%2$s
[14068] Fix | Delete
%3$s
[14069] Fix | Delete
%4$s
[14070] Fix | Delete
%5$s
[14071] Fix | Delete
%6$s
[14072] Fix | Delete
%7$s',
[14073] Fix | Delete
'' !== $current_icon_color ? sprintf( 'color:%1$s;', $current_icon_color ) : '',
[14074] Fix | Delete
'' !== $current_icon_code ? 'line-height: inherit;' : '',
[14075] Fix | Delete
'' !== $current_icon_code ? 'font-size: inherit !important;' : '',
[14076] Fix | Delete
'off' !== $current_on_hover && '' !== $current_icon_code ?
[14077] Fix | Delete
sprintf( 'margin-left: %1$s; %2$s: auto;',
[14078] Fix | Delete
'left' === $current_icon_placement ? '-1.3em' : '-1em',
[14079] Fix | Delete
'left' === $current_icon_placement ? 'right' : 'left'
[14080] Fix | Delete
)
[14081] Fix | Delete
: '',
[14082] Fix | Delete
'off' === $current_on_hover ?
[14083] Fix | Delete
sprintf( 'margin-left: %1$s; %2$s: auto;',
[14084] Fix | Delete
'left' === $current_icon_placement ? '-1.3em' : '.3em',
[14085] Fix | Delete
'left' === $current_icon_placement ? 'right' : 'left'
[14086] Fix | Delete
)
[14087] Fix | Delete
: '', // #5
[14088] Fix | Delete
'' !== $current_icon_placement && in_array( $button_use_icon , array( 'default', 'on' ) ) ? 'display: inline-block;' : '',
[14089] Fix | Delete
'off' !== $current_on_hover ? 'opacity: 0;' : 'opacity: 1;'
[14090] Fix | Delete
) );
[14091] Fix | Delete
[14092] Fix | Delete
if ( ! empty( $responsive_button_after_declaration ) ) {
[14093] Fix | Delete
self::set_style( $function_name, array(
[14094] Fix | Delete
'selector' => $css_element_processed . $button_icon_pseudo_selector,
[14095] Fix | Delete
'declaration' => $responsive_button_after_declaration,
[14096] Fix | Delete
'media_query' => ET_Builder_Element::get_media_query( $current_media_query ),
[14097] Fix | Delete
) );
[14098] Fix | Delete
}
[14099] Fix | Delete
[14100] Fix | Delete
// 2. DONE - Set custom icon and icon placement.
[14101] Fix | Delete
if ( '' !== $current_icon_code ) {
[14102] Fix | Delete
$button_icon_suffix = $prev_icon !== $current_icon ? "-{$device}" : '';
[14103] Fix | Delete
$button_icon_content = "content: attr(data-icon{$button_icon_suffix});";
[14104] Fix | Delete
$button_side_hide = ':before';
[14105] Fix | Delete
$button_side_display = ':after';
[14106] Fix | Delete
[14107] Fix | Delete
// Reverse icon position.
[14108] Fix | Delete
if ( 'left' === $current_icon_placement ) {
[14109] Fix | Delete
$button_side_hide = ':after';
[14110] Fix | Delete
$button_side_display = ':before';
[14111] Fix | Delete
}
[14112] Fix | Delete
[14113] Fix | Delete
self::set_style( $function_name, array(
[14114] Fix | Delete
'selector' => $css_element_processed . $button_side_hide,
[14115] Fix | Delete
'declaration' => 'display: none;',
[14116] Fix | Delete
'media_query' => ET_Builder_Element::get_media_query( $current_media_query ),
[14117] Fix | Delete
) );
[14118] Fix | Delete
[14119] Fix | Delete
self::set_style( $function_name, array(
[14120] Fix | Delete
'selector' => $css_element_processed . $button_side_display,
[14121] Fix | Delete
'declaration' => $button_icon_content . ' font-family: "ETmodules" !important;',
[14122] Fix | Delete
'media_query' => ET_Builder_Element::get_media_query( $current_media_query ),
[14123] Fix | Delete
) );
[14124] Fix | Delete
}
[14125] Fix | Delete
[14126] Fix | Delete
// 3. If button has default icon/hover/placement and disabled globally or not enabled in module then
[14127] Fix | Delete
// no :after:hover css should be generated.
[14128] Fix | Delete
if ( ! ( '' === $current_icon && $is_default_hover_placement ) && ( 'default' !== $button_use_icon || 'no' !== $global_use_icon_value ) ) {
[14129] Fix | Delete
$hover_after_styles = sprintf(
[14130] Fix | Delete
'%1$s
[14131] Fix | Delete
%2$s
[14132] Fix | Delete
%3$s',
[14133] Fix | Delete
'' !== $current_icon_code ?
[14134] Fix | Delete
sprintf( 'margin-left:%1$s;', '35' !== $current_icon_code ? '.3em' : '0' )
[14135] Fix | Delete
: '',
[14136] Fix | Delete
'' !== $current_icon_code ?
[14137] Fix | Delete
sprintf( '%1$s: auto; margin-left: %2$s;',
[14138] Fix | Delete
'left' === $current_icon_placement ? 'right' : 'left',
[14139] Fix | Delete
'left' === $current_icon_placement ? '-1.3em' : '.3em'
[14140] Fix | Delete
)
[14141] Fix | Delete
: '',
[14142] Fix | Delete
'off' !== $current_on_hover ? 'opacity: 1;' : ''
[14143] Fix | Delete
);
[14144] Fix | Delete
[14145] Fix | Delete
self::set_style( $function_name, array(
[14146] Fix | Delete
'selector' => $css_element_processed . ':hover' . $button_icon_pseudo_selector,
[14147] Fix | Delete
'declaration' => rtrim( $hover_after_styles ),
[14148] Fix | Delete
'media_query' => ET_Builder_Element::get_media_query( $current_media_query ),
[14149] Fix | Delete
) );
[14150] Fix | Delete
}
[14151] Fix | Delete
[14152] Fix | Delete
// Set button icon font size for default.
[14153] Fix | Delete
if ( '' === $current_icon && '' !== $current_text_size ) {
[14154] Fix | Delete
$default_icons_size = '1.6em';
[14155] Fix | Delete
$custom_icon_size = $current_text_size;
[14156] Fix | Delete
[14157] Fix | Delete
self::set_style( $function_name, array(
[14158] Fix | Delete
'selector' => $css_element_processed . $button_icon_pseudo_selector,
[14159] Fix | Delete
'declaration' => sprintf( 'font-size:%1$s;', $default_icons_size ),
[14160] Fix | Delete
'media_query' => ET_Builder_Element::get_media_query( $current_media_query ),
[14161] Fix | Delete
) );
[14162] Fix | Delete
[14163] Fix | Delete
self::set_style( $function_name, array(
[14164] Fix | Delete
'selector' => 'body.et_button_custom_icon #page-container ' . $css_element . $button_icon_pseudo_selector,
[14165] Fix | Delete
'declaration' => sprintf( 'font-size:%1$s;', $custom_icon_size ),
[14166] Fix | Delete
'media_query' => ET_Builder_Element::get_media_query( $current_media_query ),
[14167] Fix | Delete
) );
[14168] Fix | Delete
}
[14169] Fix | Delete
[14170] Fix | Delete
// Set button icon font size on hover for default.
[14171] Fix | Delete
if ( '' === $current_icon && '' !== $button_icon && '' !== $button_text_size_hover_processed ) {
[14172] Fix | Delete
$default_icons_size = '1.6em';
[14173] Fix | Delete
$custom_icon_size = $button_text_size_hover_processed;
[14174] Fix | Delete
[14175] Fix | Delete
self::set_style( $function_name, array(
[14176] Fix | Delete
'selector' => $css_element_processed . ':hover' . $button_icon_pseudo_selector,
[14177] Fix | Delete
'declaration' => sprintf( 'font-size:%1$s;', $default_icons_size ),
[14178] Fix | Delete
'media_query' => ET_Builder_Element::get_media_query( $current_media_query ),
[14179] Fix | Delete
) );
[14180] Fix | Delete
[14181] Fix | Delete
self::set_style( $function_name, array(
[14182] Fix | Delete
'selector' => 'body.et_button_custom_icon #page-container ' . $css_element . ':hover' . $button_icon_pseudo_selector,
[14183] Fix | Delete
'declaration' => sprintf( 'font-size:%1$s;', $custom_icon_size ),
[14184] Fix | Delete
'media_query' => ET_Builder_Element::get_media_query( $current_media_query ),
[14185] Fix | Delete
) );
[14186] Fix | Delete
}
[14187] Fix | Delete
}
[14188] Fix | Delete
[14189] Fix | Delete
// Set flag.
[14190] Fix | Delete
$prev_icon = $current_icon;
[14191] Fix | Delete
}
[14192] Fix | Delete
[14193] Fix | Delete
// Place to store processed background. It will be compared with the smaller device
[14194] Fix | Delete
// background processed value to avoid rendering the same styles.
[14195] Fix | Delete
$processed_background_color = '';
[14196] Fix | Delete
$processed_background_image = '';
[14197] Fix | Delete
$gradient_properties_desktop = '';
[14198] Fix | Delete
$processed_background_blend = '';
[14199] Fix | Delete
[14200] Fix | Delete
// Store background images status because the process is extensive.
[14201] Fix | Delete
$background_image_status = array(
[14202] Fix | Delete
'desktop' => false,
[14203] Fix | Delete
'tablet' => false,
[14204] Fix | Delete
'phone' => false,
[14205] Fix | Delete
);
[14206] Fix | Delete
[14207] Fix | Delete
$background_color_gradient_overlays_image_desktop = 'off';
[14208] Fix | Delete
[14209] Fix | Delete
// Background Options Styling.
[14210] Fix | Delete
foreach ( et_pb_responsive_options()->get_modes() as $device ) {
[14211] Fix | Delete
$background_base_name = "{$option_name}_bg";
[14212] Fix | Delete
$background_prefix = "{$background_base_name}_";
[14213] Fix | Delete
$background_style = '';
[14214] Fix | Delete
$is_desktop = 'desktop' === $device;
[14215] Fix | Delete
$suffix = ! $is_desktop ? "_{$device}" : '';
[14216] Fix | Delete
[14217] Fix | Delete
$background_color_style = '';
[14218] Fix | Delete
$background_image_style = '';
[14219] Fix | Delete
$background_images = array();
[14220] Fix | Delete
[14221] Fix | Delete
$has_background_color_gradient = false;
[14222] Fix | Delete
$has_background_image = false;
[14223] Fix | Delete
$has_background_gradient_and_image = false;
[14224] Fix | Delete
$is_background_color_gradient_disabled = false;
[14225] Fix | Delete
$is_background_image_disabled = false;
[14226] Fix | Delete
[14227] Fix | Delete
$background_color_gradient_overlays_image = 'off';
[14228] Fix | Delete
[14229] Fix | Delete
// Ensure responsive is active.
[14230] Fix | Delete
if ( ! $is_desktop && ! et_pb_responsive_options()->is_responsive_enabled( $this->props, "{$option_name}_bg_color" ) ) {
[14231] Fix | Delete
continue;
[14232] Fix | Delete
}
[14233] Fix | Delete
[14234] Fix | Delete
// A. Background Gradient.
[14235] Fix | Delete
$use_background_color_gradient = et_pb_responsive_options()->get_inheritance_background_value( $this->props, "{$background_prefix}use_color_gradient", $device, $background_base_name, $this->fields_unprocessed );
[14236] Fix | Delete
[14237] Fix | Delete
if ( 'on' === $use_background_color_gradient ) {
[14238] Fix | Delete
$background_color_gradient_overlays_image = et_pb_responsive_options()->get_any_value( $this->props, "{$background_prefix}color_gradient_overlays_image{$suffix}", '', true );
[14239] Fix | Delete
[14240] Fix | Delete
$gradient_properties = array(
[14241] Fix | Delete
'type' => et_pb_responsive_options()->get_any_value( $this->props, "{$background_prefix}color_gradient_type{$suffix}", '', true ),
[14242] Fix | Delete
'direction' => et_pb_responsive_options()->get_any_value( $this->props, "{$background_prefix}color_gradient_direction{$suffix}", '', true ),
[14243] Fix | Delete
'radial_direction' => et_pb_responsive_options()->get_any_value( $this->props, "{$background_prefix}color_gradient_direction_radial{$suffix}", '', true ),
[14244] Fix | Delete
'color_start' => et_pb_responsive_options()->get_any_value( $this->props, "{$background_prefix}color_gradient_start{$suffix}", '', true ),
[14245] Fix | Delete
'color_end' => et_pb_responsive_options()->get_any_value( $this->props, "{$background_prefix}color_gradient_end{$suffix}", '', true ),
[14246] Fix | Delete
'start_position' => et_pb_responsive_options()->get_any_value( $this->props, "{$background_prefix}color_gradient_start_position{$suffix}", '', true ),
[14247] Fix | Delete
'end_position' => et_pb_responsive_options()->get_any_value( $this->props, "{$background_prefix}color_gradient_end_position{$suffix}", '', true ),
[14248] Fix | Delete
);
[14249] Fix | Delete
[14250] Fix | Delete
// Will be used as hover default.
[14251] Fix | Delete
if ( 'desktop' === $device ) {
[14252] Fix | Delete
$gradient_properties_desktop = $gradient_properties;
[14253] Fix | Delete
$background_color_gradient_overlays_image_desktop = $background_color_gradient_overlays_image;
[14254] Fix | Delete
}
[14255] Fix | Delete
[14256] Fix | Delete
// Save background gradient into background images list.
[14257] Fix | Delete
$background_images[] = $this->get_gradient( $gradient_properties );
[14258] Fix | Delete
[14259] Fix | Delete
// Flag to inform BG Color if current module has Gradient.
[14260] Fix | Delete
$has_background_color_gradient = true;
[14261] Fix | Delete
} else if ( 'off' === $use_background_color_gradient ) {
[14262] Fix | Delete
$is_background_color_gradient_disabled = true;
[14263] Fix | Delete
}
[14264] Fix | Delete
[14265] Fix | Delete
// B. Background Image.
[14266] Fix | Delete
$background_image = et_pb_responsive_options()->get_inheritance_background_value( $this->props, "{$background_prefix}image", $device, $background_base_name, $this->fields_unprocessed );
[14267] Fix | Delete
$parallax = et_pb_responsive_options()->get_any_value( $this->props, "{$background_prefix}parallax{$suffix}", 'off' );
[14268] Fix | Delete
[14269] Fix | Delete
// BG image and parallax status.
[14270] Fix | Delete
$is_background_image_active = '' !== $background_image && 'on' !== $parallax;
[14271] Fix | Delete
$background_image_status[ $device ] = $is_background_image_active;
[14272] Fix | Delete
[14273] Fix | Delete
if ( $is_background_image_active ) {
[14274] Fix | Delete
// Flag to inform BG Color if current module has Image.
[14275] Fix | Delete
$has_background_image = true;
[14276] Fix | Delete
[14277] Fix | Delete
// Check previous BG image status. Needed to get the correct value.
[14278] Fix | Delete
$is_prev_background_image_active = true;
[14279] Fix | Delete
if ( ! $is_desktop ) {
[14280] Fix | Delete
$is_prev_background_image_active = 'tablet' === $device ? $background_image_status['desktop'] : $background_image_status['tablet'];
[14281] Fix | Delete
}
[14282] Fix | Delete
[14283] Fix | Delete
// Size.
[14284] Fix | Delete
$background_size_default = self::$_->array_get( $this->fields_unprocessed, "{$background_prefix}size.default", '' );
[14285] Fix | Delete
$background_size = et_pb_responsive_options()->get_any_value( $this->props, "{$background_prefix}size{$suffix}", $background_size_default, ! $is_prev_background_image_active );
[14286] Fix | Delete
[14287] Fix | Delete
if ( '' !== $background_size ) {
[14288] Fix | Delete
$background_style .= sprintf(
[14289] Fix | Delete
'background-size: %1$s; ',
[14290] Fix | Delete
esc_html( $background_size )
[14291] Fix | Delete
);
[14292] Fix | Delete
}
[14293] Fix | Delete
[14294] Fix | Delete
// Position.
[14295] Fix | Delete
$background_position_default = self::$_->array_get( $this->fields_unprocessed, "{$background_prefix}position.default", '' );
[14296] Fix | Delete
$background_position = et_pb_responsive_options()->get_any_value( $this->props, "{$background_prefix}position{$suffix}", $background_position_default, ! $is_prev_background_image_active );
[14297] Fix | Delete
[14298] Fix | Delete
if ( '' !== $background_position ) {
[14299] Fix | Delete
$background_style .= sprintf(
[14300] Fix | Delete
'background-position: %1$s; ',
[14301] Fix | Delete
esc_html( str_replace( '_', ' ', $background_position ) )
[14302] Fix | Delete
);
[14303] Fix | Delete
}
[14304] Fix | Delete
[14305] Fix | Delete
// Repeat.
[14306] Fix | Delete
$background_repeat_default = self::$_->array_get( $this->fields_unprocessed, "{$background_prefix}repeat.default", '' );
[14307] Fix | Delete
$background_repeat = et_pb_responsive_options()->get_any_value( $this->props, "{$background_prefix}repeat{$suffix}", $background_repeat_default, ! $is_prev_background_image_active );
[14308] Fix | Delete
[14309] Fix | Delete
if ( '' !== $background_repeat ) {
[14310] Fix | Delete
$background_style .= sprintf(
[14311] Fix | Delete
'background-repeat: %1$s; ',
[14312] Fix | Delete
esc_html( $background_repeat )
[14313] Fix | Delete
);
[14314] Fix | Delete
}
[14315] Fix | Delete
[14316] Fix | Delete
// Blend.
[14317] Fix | Delete
$background_blend_default = self::$_->array_get( $this->fields_unprocessed, "{$background_prefix}blend.default", '' );
[14318] Fix | Delete
$background_blend = et_pb_responsive_options()->get_any_value( $this->props, "{$background_prefix}blend{$suffix}", $background_blend_default, ! $is_prev_background_image_active );
[14319] Fix | Delete
$background_blend_inherit = et_pb_responsive_options()->get_any_value( $this->props, "{$background_prefix}blend{$suffix}", '', true );
[14320] Fix | Delete
[14321] Fix | Delete
if ( '' !== $background_blend_inherit ) {
[14322] Fix | Delete
// Don't print the same image blend style.
[14323] Fix | Delete
if ( '' !== $background_blend ) {
[14324] Fix | Delete
$background_style .= sprintf(
[14325] Fix | Delete
'background-blend-mode: %1$s; ',
[14326] Fix | Delete
esc_html( $background_blend )
[14327] Fix | Delete
);
[14328] Fix | Delete
}
[14329] Fix | Delete
[14330] Fix | Delete
// Reset - If background has image and gradient, force background-color: initial.
[14331] Fix | Delete
if ( $has_background_color_gradient && $has_background_image && $background_blend_inherit !== $background_blend_default ) {
[14332] Fix | Delete
$has_background_gradient_and_image = true;
[14333] Fix | Delete
$background_color_style = 'initial';
[14334] Fix | Delete
$background_style .= 'background-color: initial; ';
[14335] Fix | Delete
}
[14336] Fix | Delete
[14337] Fix | Delete
$processed_background_blend = $background_blend;
[14338] Fix | Delete
}
[14339] Fix | Delete
[14340] Fix | Delete
// Only append background image when the image is exist.
[14341] Fix | Delete
$background_images[] = sprintf( 'url(%1$s)', esc_html( $background_image ) );
[14342] Fix | Delete
} else if ( '' === $background_image ) {
[14343] Fix | Delete
// Reset - If background image is disabled, ensure we reset prev background blend mode.
[14344] Fix | Delete
if ( '' !== $processed_background_blend ) {
[14345] Fix | Delete
$background_style .= 'background-blend-mode: normal; ';
[14346] Fix | Delete
$processed_background_blend = '';
[14347] Fix | Delete
}
[14348] Fix | Delete
[14349] Fix | Delete
$is_background_image_disabled = true;
[14350] Fix | Delete
}
[14351] Fix | Delete
[14352] Fix | Delete
if ( ! empty( $background_images ) ) {
[14353] Fix | Delete
// The browsers stack the images in the opposite order to what you'd expect.
[14354] Fix | Delete
if ( 'on' !== $background_color_gradient_overlays_image ) {
[14355] Fix | Delete
$background_images = array_reverse( $background_images );
[14356] Fix | Delete
}
[14357] Fix | Delete
[14358] Fix | Delete
// Set background image styles only it's different compared to the larger device.
[14359] Fix | Delete
$background_image_style = join( ', ', $background_images );
[14360] Fix | Delete
if ( $processed_background_image !== $background_image_style ) {
[14361] Fix | Delete
$background_style .= sprintf(
[14362] Fix | Delete
'background-image: %1$s !important;',
[14363] Fix | Delete
esc_html( $background_image_style )
[14364] Fix | Delete
);
[14365] Fix | Delete
}
[14366] Fix | Delete
} else if ( ! $is_desktop && $is_background_color_gradient_disabled && $is_background_image_disabled ) {
[14367] Fix | Delete
// Reset - If background image and gradient are disabled, reset current background image.
[14368] Fix | Delete
$background_image_style = 'initial';
[14369] Fix | Delete
$background_style .= 'background-image: initial !important;';
[14370] Fix | Delete
}
[14371] Fix | Delete
[14372] Fix | Delete
// Save processed background images.
[14373] Fix | Delete
$processed_background_image = $background_image_style;
[14374] Fix | Delete
[14375] Fix | Delete
// C. Background Color.
[14376] Fix | Delete
if ( ! $has_background_gradient_and_image ) {
[14377] Fix | Delete
// Background color `initial` was added by default to reset button background
[14378] Fix | Delete
// color when user disable it on mobile preview mode. However, it should
[14379] Fix | Delete
// be applied only when the background color is really disabled because user
[14380] Fix | Delete
// may use theme customizer to setup global button background color. We also
[14381] Fix | Delete
// need to ensure user still able to disable background color on mobile.
[14382] Fix | Delete
$background_color_enable = self::$_->array_get( $this->props, "{$background_prefix}enable_color{$suffix}", '' );
[14383] Fix | Delete
$background_color_initial = 'off' === $background_color_enable && ! $is_desktop ? 'initial' : '';
[14384] Fix | Delete
[14385] Fix | Delete
$background_color = et_pb_responsive_options()->get_inheritance_background_value( $this->props, "{$background_prefix}color", $device, $background_base_name, $this->fields_unprocessed );
[14386] Fix | Delete
$background_color = '' !== $background_color ? $background_color : $background_color_initial;
[14387] Fix | Delete
$background_color_style = $background_color;
[14388] Fix | Delete
[14389] Fix | Delete
if ( '' !== $background_color && $processed_background_color !== $background_color ) {
[14390] Fix | Delete
$background_style .= sprintf(
[14391] Fix | Delete
'background-color: %1$s%2$s; ',
[14392] Fix | Delete
esc_html( $background_color ),
[14393] Fix | Delete
esc_html( $important )
[14394] Fix | Delete
);
[14395] Fix | Delete
}
[14396] Fix | Delete
}
[14397] Fix | Delete
[14398] Fix | Delete
// Save processed background color.
[14399] Fix | Delete
$processed_background_color = $background_color_style;
[14400] Fix | Delete
[14401] Fix | Delete
// Print background gradient and image styles.
[14402] Fix | Delete
if ( '' !== $background_style ) {
[14403] Fix | Delete
$background_style_attrs = array(
[14404] Fix | Delete
'selector' => $css_element_processed,
[14405] Fix | Delete
'declaration' => rtrim( $background_style ),
[14406] Fix | Delete
'priority' => $this->_style_priority,
[14407] Fix | Delete
);
[14408] Fix | Delete
[14409] Fix | Delete
// Add media query attribute to background style attrs.
[14410] Fix | Delete
if ( 'desktop' !== $device ) {
[14411] Fix | Delete
$current_media_query = 'tablet' === $device ? 'max_width_980' : 'max_width_767';
[14412] Fix | Delete
$background_style_attrs['media_query'] = ET_Builder_Element::get_media_query( $current_media_query );
[14413] Fix | Delete
}
[14414] Fix | Delete
[14415] Fix | Delete
self::set_style( $function_name, $background_style_attrs );
[14416] Fix | Delete
}
[14417] Fix | Delete
}
[14418] Fix | Delete
[14419] Fix | Delete
// Background Hover.
[14420] Fix | Delete
if ( et_builder_is_hover_enabled( "{$option_name}_bg_color", $this->props ) ) {
[14421] Fix | Delete
$background_base_name = "{$option_name}_bg";
[14422] Fix | Delete
$background_prefix = "{$background_base_name}_";
[14423] Fix | Delete
$background_images_hover = array();
[14424] Fix | Delete
$background_hover_style = '';
[14425] Fix | Delete
[14426] Fix | Delete
$has_background_color_gradient_hover = false;
[14427] Fix | Delete
$has_background_image_hover = false;
[14428] Fix | Delete
$has_background_gradient_and_image_hover = false;
[14429] Fix | Delete
$is_background_color_gradient_hover_disabled = false;
[14430] Fix | Delete
$is_background_image_hover_disabled = false;
[14431] Fix | Delete
[14432] Fix | Delete
$background_color_gradient_overlays_image_hover = 'off';
[14433] Fix | Delete
[14434] Fix | Delete
// Background Gradient Hover.
[14435] Fix | Delete
// This part is little bit different compared to other hover implementation. In
[14436] Fix | Delete
// this case, hover is enabled on the background field, not on the each of those
[14437] Fix | Delete
// fields. So, built in function get_value() doesn't work in this case.
[14438] Fix | Delete
// Temporarily, we need to fetch the the value from get_raw_value().
[14439] Fix | Delete
$use_background_color_gradient_hover = et_pb_responsive_options()->get_inheritance_background_value( $this->props, "{$background_prefix}use_color_gradient", 'hover', $background_base_name, $this->fields_unprocessed );
[14440] Fix | Delete
[14441] Fix | Delete
if ( 'on' === $use_background_color_gradient_hover ) {
[14442] Fix | Delete
// Desktop value as default.
[14443] Fix | Delete
$background_color_gradient_type_desktop = self::$_->array_get( $gradient_properties_desktop, 'type', '' );
[14444] Fix | Delete
$background_color_gradient_direction_desktop = self::$_->array_get( $gradient_properties_desktop, 'direction', '' );
[14445] Fix | Delete
$background_color_gradient_radial_direction_desktop = self::$_->array_get( $gradient_properties_desktop, 'radial_direction', '' );
[14446] Fix | Delete
$background_color_gradient_color_start_desktop = self::$_->array_get( $gradient_properties_desktop, 'color_start', '' );
[14447] Fix | Delete
$background_color_gradient_color_end_desktop = self::$_->array_get( $gradient_properties_desktop, 'color_end', '' );
[14448] Fix | Delete
$background_color_gradient_start_position_desktop = self::$_->array_get( $gradient_properties_desktop, 'start_position', '' );
[14449] Fix | Delete
$background_color_gradient_end_position_desktop = self::$_->array_get( $gradient_properties_desktop, 'end_position', '' );
[14450] Fix | Delete
[14451] Fix | Delete
// Hover value.
[14452] Fix | Delete
$background_color_gradient_type_hover = et_pb_hover_options()->get_raw_value( "{$background_prefix}color_gradient_type", $this->props, $background_color_gradient_type_desktop );
[14453] Fix | Delete
$background_color_gradient_direction_hover = et_pb_hover_options()->get_raw_value( "{$background_prefix}color_gradient_direction", $this->props, $background_color_gradient_direction_desktop );
[14454] Fix | Delete
$background_color_gradient_direction_radial_hover = et_pb_hover_options()->get_raw_value( "{$background_prefix}color_gradient_direction_radial", $this->props, $background_color_gradient_radial_direction_desktop );
[14455] Fix | Delete
$background_color_gradient_start_hover = et_pb_hover_options()->get_raw_value( "{$background_prefix}color_gradient_start", $this->props, $background_color_gradient_color_start_desktop );
[14456] Fix | Delete
$background_color_gradient_end_hover = et_pb_hover_options()->get_raw_value( "{$background_prefix}color_gradient_end", $this->props, $background_color_gradient_color_end_desktop );
[14457] Fix | Delete
$background_color_gradient_start_position_hover = et_pb_hover_options()->get_raw_value( "{$background_prefix}color_gradient_start_position", $this->props, $background_color_gradient_start_position_desktop );
[14458] Fix | Delete
$background_color_gradient_end_position_hover = et_pb_hover_options()->get_raw_value( "{$background_prefix}color_gradient_end_position", $this->props, $background_color_gradient_end_position_desktop );
[14459] Fix | Delete
$background_color_gradient_overlays_image_hover = et_pb_hover_options()->get_raw_value( "{$background_prefix}color_gradient_overlays_image", $this->props, $background_color_gradient_overlays_image_desktop );
[14460] Fix | Delete
[14461] Fix | Delete
$has_background_color_gradient_hover = true;
[14462] Fix | Delete
[14463] Fix | Delete
$gradient_values_hover = array(
[14464] Fix | Delete
'type' => '' !== $background_color_gradient_type_hover ? $background_color_gradient_type_hover : $background_color_gradient_type_desktop,
[14465] Fix | Delete
'direction' => '' !== $background_color_gradient_direction_hover ? $background_color_gradient_direction_hover : $background_color_gradient_direction_desktop,
[14466] Fix | Delete
'radial_direction' => '' !== $background_color_gradient_direction_radial_hover ? $background_color_gradient_direction_radial_hover : $background_color_gradient_radial_direction_desktop,
[14467] Fix | Delete
'color_start' => '' !== $background_color_gradient_start_hover ? $background_color_gradient_start_hover : $background_color_gradient_color_start_desktop,
[14468] Fix | Delete
'color_end' => '' !== $background_color_gradient_end_hover ? $background_color_gradient_end_hover : $background_color_gradient_color_end_desktop,
[14469] Fix | Delete
'start_position' => '' !== $background_color_gradient_start_position_hover ? $background_color_gradient_start_position_hover : $background_color_gradient_start_position_desktop,
[14470] Fix | Delete
'end_position' => '' !== $background_color_gradient_end_position_hover ? $background_color_gradient_end_position_hover : $background_color_gradient_end_position_desktop,
[14471] Fix | Delete
);
[14472] Fix | Delete
[14473] Fix | Delete
$background_images_hover[] = $this->get_gradient( $gradient_values_hover );
[14474] Fix | Delete
} else if ( 'off' === $use_background_color_gradient_hover ) {
[14475] Fix | Delete
$is_background_color_gradient_hover_disabled = true;
[14476] Fix | Delete
}
[14477] Fix | Delete
[14478] Fix | Delete
// Background Image Hover.
[14479] Fix | Delete
// This part is little bit different compared to other hover implementation. In
[14480] Fix | Delete
// this case, hover is enabled on the background field, not on the each of those
[14481] Fix | Delete
// fields. So, built in function get_value() doesn't work in this case.
[14482] Fix | Delete
// Temporarily, we need to fetch the the value from get_raw_value().
[14483] Fix | Delete
$background_image_hover = et_pb_responsive_options()->get_inheritance_background_value( $this->props, "{$background_prefix}image", 'hover', $background_base_name, $this->fields_unprocessed );
[14484] Fix | Delete
$parallax_hover = et_pb_hover_options()->get_raw_value( "{$background_prefix}parallax", $this->props );
[14485] Fix | Delete
[14486] Fix | Delete
if ( '' !== $background_image_hover && null !== $background_image_hover && 'on' !== $parallax_hover ) {
[14487] Fix | Delete
// Flag to inform BG Color if current module has Image.
[14488] Fix | Delete
$has_background_image_hover = true;
[14489] Fix | Delete
[14490] Fix | Delete
// Size.
[14491] Fix | Delete
$background_size_hover = et_pb_hover_options()->get_raw_value( "{$background_prefix}size", $this->props );
[14492] Fix | Delete
$background_size_desktop = self::$_->array_get( $this->props, "{$background_prefix}size", '' );
[14493] Fix | Delete
$is_same_background_size = $background_size_hover === $background_size_desktop;
[14494] Fix | Delete
if ( empty( $background_size_hover ) && ! empty( $background_size_desktop ) ) {
[14495] Fix | Delete
$background_size_hover = $background_size_desktop;
[14496] Fix | Delete
}
[14497] Fix | Delete
[14498] Fix | Delete
if ( ! empty( $background_size_hover ) && ! $is_same_background_size ) {
[14499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function