: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
// Flag to inform BG Color if current module has Image.
$image_size_hover = et_pb_hover_options()->get_raw_value( "{$base_prop_name}_size", $props );
$image_size_desktop = et_()->array_get( $props, "{$base_prop_name}_size", '' );
$is_same_image_size = $image_size_hover === $image_size_desktop;
if ( empty( $image_size_hover ) && ! empty( $image_size_desktop ) ) {
$image_size_hover = $image_size_desktop;
if ( ! empty( $image_size_hover ) && ! $is_same_image_size ) {
'background-size: %1$s; ',
esc_html( $image_size_hover )
$image_position_hover = et_pb_hover_options()->get_raw_value( "{$base_prop_name}_position", $props );
$image_position_desktop = et_()->array_get( $props, "{$base_prop_name}_position", '' );
$is_same_image_position = $image_position_hover === $image_position_desktop;
if ( empty( $image_position_hover ) && ! empty( $image_position_desktop ) ) {
$image_position_hover = $image_position_desktop;
if ( ! empty( $image_position_hover ) && ! $is_same_image_position ) {
'background-position: %1$s; ',
esc_html( str_replace( '_', ' ', $image_position_hover ) )
$image_repeat_hover = et_pb_hover_options()->get_raw_value( "{$base_prop_name}_repeat", $props );
$image_repeat_desktop = et_()->array_get( $props, "{$base_prop_name}_repeat", '' );
$is_same_image_repeat = $image_repeat_hover === $image_repeat_desktop;
if ( empty( $image_repeat_hover ) && ! empty( $image_repeat_desktop ) ) {
$image_repeat_hover = $image_repeat_desktop;
if ( ! empty( $image_repeat_hover ) && ! $is_same_image_repeat ) {
'background-repeat: %1$s; ',
esc_html( $image_repeat_hover )
$image_blend_hover = et_pb_hover_options()->get_raw_value( "{$base_prop_name}_blend", $props );
$image_blend_default = et_()->array_get( $fields_definition, "{$base_prop_name}_blend.default", '' );
$image_blend_desktop = et_()->array_get( $props, "{$base_prop_name}_blend", '' );
$is_same_image_blend = $image_blend_hover === $image_blend_desktop;
if ( empty( $image_blend_hover ) && ! empty( $image_blend_desktop ) ) {
$image_blend_hover = $image_blend_desktop;
if ( ! empty( $image_blend_hover ) ) {
// Don't print the same background blend.
if ( ! $is_same_image_blend ) {
'background-blend-mode: %1$s; ',
esc_html( $image_blend_hover )
// Force background-color: initial;
if ( $has_gradient_hover && $has_image_hover && $image_blend_hover !== $image_blend_default ) {
$has_gradient_and_image_hover = true;
$style_hover .= sprintf( 'background-color: initial%1$s; ', esc_html( $important ) );
// Only append background image when the image is exist.
$images_hover[] = sprintf( 'url(%1$s)', esc_html( $image_hover ) );
} else if ( '' === $image_hover ) {
$is_image_hover_disabled = true;
if ( ! empty( $images_hover ) ) {
// The browsers stack the images in the opposite order to what you'd expect.
if ( 'on' !== $gradient_overlays_image_hover ) {
$images_hover = array_reverse( $images_hover );
'background-image: %1$s%2$s;',
esc_html( join( ', ', $images_hover ) ),
} else if ( $is_gradient_hover_disabled && $is_image_hover_disabled ) {
'background-image: initial %1$s;',
// Background Color Hover.
if ( $use_color_options && 'fields_only' !== $use_color_options ) {
$use_color_hover_value = et_()->array_get( $props, "use_{$base_prop_name}_color__hover", '' );
$use_color_hover_value = ! empty( $use_color_hover_value ) ?
et_()->array_get( $props, "use_{$base_prop_name}_color", 'on' );
if ( ! $has_gradient_and_image_hover && 'off' !== $use_color_hover_value ) {
$color_hover = et_pb_responsive_options()->get_inheritance_background_value( $props, "{$base_prop_name}_color", 'hover', $base_prop_name, $fields_definition );
$color_hover = '' !== $color_hover ? $color_hover : 'transparent';
if ( '' !== $color_hover ) {
'background-color: %1$s%2$s; ',
esc_html( $color_hover ),
} else if ( $has_color_toggle_options && 'off' === $use_color_hover_value ) {
// Reset - If current module has background color toggle, it's off, and current mode
// it's not desktop, we should reset the background color.
'background-color: initial %1$s; ',
// Render background hover styles.
if ( '' !== $style_hover ) {
ET_Builder_Element::set_style(
'selector' => $selector_hover,
'declaration' => rtrim( $style_hover ),