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/module/helpers
File: Background.php
// Flag to inform BG Color if current module has Image.
[500] Fix | Delete
$has_image_hover = true;
[501] Fix | Delete
[502] Fix | Delete
// Size.
[503] Fix | Delete
$image_size_hover = et_pb_hover_options()->get_raw_value( "{$base_prop_name}_size", $props );
[504] Fix | Delete
$image_size_desktop = et_()->array_get( $props, "{$base_prop_name}_size", '' );
[505] Fix | Delete
$is_same_image_size = $image_size_hover === $image_size_desktop;
[506] Fix | Delete
[507] Fix | Delete
if ( empty( $image_size_hover ) && ! empty( $image_size_desktop ) ) {
[508] Fix | Delete
$image_size_hover = $image_size_desktop;
[509] Fix | Delete
}
[510] Fix | Delete
[511] Fix | Delete
if ( ! empty( $image_size_hover ) && ! $is_same_image_size ) {
[512] Fix | Delete
$style_hover .= sprintf(
[513] Fix | Delete
'background-size: %1$s; ',
[514] Fix | Delete
esc_html( $image_size_hover )
[515] Fix | Delete
);
[516] Fix | Delete
}
[517] Fix | Delete
[518] Fix | Delete
// Position.
[519] Fix | Delete
$image_position_hover = et_pb_hover_options()->get_raw_value( "{$base_prop_name}_position", $props );
[520] Fix | Delete
$image_position_desktop = et_()->array_get( $props, "{$base_prop_name}_position", '' );
[521] Fix | Delete
$is_same_image_position = $image_position_hover === $image_position_desktop;
[522] Fix | Delete
[523] Fix | Delete
if ( empty( $image_position_hover ) && ! empty( $image_position_desktop ) ) {
[524] Fix | Delete
$image_position_hover = $image_position_desktop;
[525] Fix | Delete
}
[526] Fix | Delete
[527] Fix | Delete
if ( ! empty( $image_position_hover ) && ! $is_same_image_position ) {
[528] Fix | Delete
$style_hover .= sprintf(
[529] Fix | Delete
'background-position: %1$s; ',
[530] Fix | Delete
esc_html( str_replace( '_', ' ', $image_position_hover ) )
[531] Fix | Delete
);
[532] Fix | Delete
}
[533] Fix | Delete
[534] Fix | Delete
// Repeat.
[535] Fix | Delete
$image_repeat_hover = et_pb_hover_options()->get_raw_value( "{$base_prop_name}_repeat", $props );
[536] Fix | Delete
$image_repeat_desktop = et_()->array_get( $props, "{$base_prop_name}_repeat", '' );
[537] Fix | Delete
$is_same_image_repeat = $image_repeat_hover === $image_repeat_desktop;
[538] Fix | Delete
[539] Fix | Delete
if ( empty( $image_repeat_hover ) && ! empty( $image_repeat_desktop ) ) {
[540] Fix | Delete
$image_repeat_hover = $image_repeat_desktop;
[541] Fix | Delete
}
[542] Fix | Delete
[543] Fix | Delete
if ( ! empty( $image_repeat_hover ) && ! $is_same_image_repeat ) {
[544] Fix | Delete
$style_hover .= sprintf(
[545] Fix | Delete
'background-repeat: %1$s; ',
[546] Fix | Delete
esc_html( $image_repeat_hover )
[547] Fix | Delete
);
[548] Fix | Delete
}
[549] Fix | Delete
[550] Fix | Delete
// Blend.
[551] Fix | Delete
$image_blend_hover = et_pb_hover_options()->get_raw_value( "{$base_prop_name}_blend", $props );
[552] Fix | Delete
$image_blend_default = et_()->array_get( $fields_definition, "{$base_prop_name}_blend.default", '' );
[553] Fix | Delete
$image_blend_desktop = et_()->array_get( $props, "{$base_prop_name}_blend", '' );
[554] Fix | Delete
$is_same_image_blend = $image_blend_hover === $image_blend_desktop;
[555] Fix | Delete
[556] Fix | Delete
if ( empty( $image_blend_hover ) && ! empty( $image_blend_desktop ) ) {
[557] Fix | Delete
$image_blend_hover = $image_blend_desktop;
[558] Fix | Delete
}
[559] Fix | Delete
[560] Fix | Delete
if ( ! empty( $image_blend_hover ) ) {
[561] Fix | Delete
// Don't print the same background blend.
[562] Fix | Delete
if ( ! $is_same_image_blend ) {
[563] Fix | Delete
$style_hover .= sprintf(
[564] Fix | Delete
'background-blend-mode: %1$s; ',
[565] Fix | Delete
esc_html( $image_blend_hover )
[566] Fix | Delete
);
[567] Fix | Delete
}
[568] Fix | Delete
[569] Fix | Delete
// Force background-color: initial;
[570] Fix | Delete
if ( $has_gradient_hover && $has_image_hover && $image_blend_hover !== $image_blend_default ) {
[571] Fix | Delete
$has_gradient_and_image_hover = true;
[572] Fix | Delete
$style_hover .= sprintf( 'background-color: initial%1$s; ', esc_html( $important ) );
[573] Fix | Delete
}
[574] Fix | Delete
}
[575] Fix | Delete
[576] Fix | Delete
// Only append background image when the image is exist.
[577] Fix | Delete
$images_hover[] = sprintf( 'url(%1$s)', esc_html( $image_hover ) );
[578] Fix | Delete
} else if ( '' === $image_hover ) {
[579] Fix | Delete
$is_image_hover_disabled = true;
[580] Fix | Delete
}
[581] Fix | Delete
}
[582] Fix | Delete
[583] Fix | Delete
if ( ! empty( $images_hover ) ) {
[584] Fix | Delete
// The browsers stack the images in the opposite order to what you'd expect.
[585] Fix | Delete
if ( 'on' !== $gradient_overlays_image_hover ) {
[586] Fix | Delete
$images_hover = array_reverse( $images_hover );
[587] Fix | Delete
}
[588] Fix | Delete
[589] Fix | Delete
$style_hover .= sprintf(
[590] Fix | Delete
'background-image: %1$s%2$s;',
[591] Fix | Delete
esc_html( join( ', ', $images_hover ) ),
[592] Fix | Delete
$important
[593] Fix | Delete
);
[594] Fix | Delete
} else if ( $is_gradient_hover_disabled && $is_image_hover_disabled ) {
[595] Fix | Delete
$style_hover .= sprintf(
[596] Fix | Delete
'background-image: initial %1$s;',
[597] Fix | Delete
$important
[598] Fix | Delete
);
[599] Fix | Delete
}
[600] Fix | Delete
[601] Fix | Delete
// Background Color Hover.
[602] Fix | Delete
if ( $use_color_options && 'fields_only' !== $use_color_options ) {
[603] Fix | Delete
[604] Fix | Delete
$use_color_hover_value = et_()->array_get( $props, "use_{$base_prop_name}_color__hover", '' );
[605] Fix | Delete
$use_color_hover_value = ! empty( $use_color_hover_value ) ?
[606] Fix | Delete
$use_color_hover_value :
[607] Fix | Delete
et_()->array_get( $props, "use_{$base_prop_name}_color", 'on' );
[608] Fix | Delete
[609] Fix | Delete
if ( ! $has_gradient_and_image_hover && 'off' !== $use_color_hover_value ) {
[610] Fix | Delete
$color_hover = et_pb_responsive_options()->get_inheritance_background_value( $props, "{$base_prop_name}_color", 'hover', $base_prop_name, $fields_definition );
[611] Fix | Delete
$color_hover = '' !== $color_hover ? $color_hover : 'transparent';
[612] Fix | Delete
[613] Fix | Delete
if ( '' !== $color_hover ) {
[614] Fix | Delete
$style_hover .= sprintf(
[615] Fix | Delete
'background-color: %1$s%2$s; ',
[616] Fix | Delete
esc_html( $color_hover ),
[617] Fix | Delete
esc_html( $important )
[618] Fix | Delete
);
[619] Fix | Delete
}
[620] Fix | Delete
} else if ( $has_color_toggle_options && 'off' === $use_color_hover_value ) {
[621] Fix | Delete
// Reset - If current module has background color toggle, it's off, and current mode
[622] Fix | Delete
// it's not desktop, we should reset the background color.
[623] Fix | Delete
$style .= sprintf(
[624] Fix | Delete
'background-color: initial %1$s; ',
[625] Fix | Delete
esc_html( $important )
[626] Fix | Delete
);
[627] Fix | Delete
}
[628] Fix | Delete
}
[629] Fix | Delete
[630] Fix | Delete
// Render background hover styles.
[631] Fix | Delete
if ( '' !== $style_hover ) {
[632] Fix | Delete
ET_Builder_Element::set_style(
[633] Fix | Delete
$function_name,
[634] Fix | Delete
array(
[635] Fix | Delete
'selector' => $selector_hover,
[636] Fix | Delete
'declaration' => rtrim( $style_hover ),
[637] Fix | Delete
'priority' => $priority,
[638] Fix | Delete
)
[639] Fix | Delete
);
[640] Fix | Delete
}
[641] Fix | Delete
}
[642] Fix | Delete
}
[643] Fix | Delete
}
[644] Fix | Delete
[645] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function