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
if ( $is_background_image_active ) {
[12000] Fix | Delete
// Flag to inform BG Color if current module has Image.
[12001] Fix | Delete
$has_background_image = true;
[12002] Fix | Delete
[12003] Fix | Delete
// Check previous BG image status. Needed to get the correct value.
[12004] Fix | Delete
$is_prev_background_image_active = true;
[12005] Fix | Delete
if ( ! $is_desktop ) {
[12006] Fix | Delete
$is_prev_background_image_active = 'tablet' === $device ? $background_image_status['desktop'] : $background_image_status['tablet'];
[12007] Fix | Delete
}
[12008] Fix | Delete
[12009] Fix | Delete
// Size.
[12010] Fix | Delete
$background_size_default = self::$_->array_get( $this->fields_unprocessed, 'background_size.default', '' );
[12011] Fix | Delete
$background_size = et_pb_responsive_options()->get_any_value( $this->props, "background_size{$suffix}", $background_size_default, ! $is_prev_background_image_active );
[12012] Fix | Delete
[12013] Fix | Delete
if ( '' !== $background_size ) {
[12014] Fix | Delete
$style .= sprintf(
[12015] Fix | Delete
'background-size: %1$s; ',
[12016] Fix | Delete
esc_html( $background_size )
[12017] Fix | Delete
);
[12018] Fix | Delete
}
[12019] Fix | Delete
[12020] Fix | Delete
// Position.
[12021] Fix | Delete
$background_position_default = self::$_->array_get( $this->fields_unprocessed, 'background_position.default', '' );
[12022] Fix | Delete
$background_position = et_pb_responsive_options()->get_any_value( $this->props, "background_position{$suffix}", $background_position_default, ! $is_prev_background_image_active );
[12023] Fix | Delete
[12024] Fix | Delete
if ( '' !== $background_position ) {
[12025] Fix | Delete
$style .= sprintf(
[12026] Fix | Delete
'background-position: %1$s; ',
[12027] Fix | Delete
esc_html( str_replace( '_', ' ', $background_position ) )
[12028] Fix | Delete
);
[12029] Fix | Delete
}
[12030] Fix | Delete
[12031] Fix | Delete
// Repeat.
[12032] Fix | Delete
$background_repeat_default = self::$_->array_get( $this->fields_unprocessed, 'background_repeat.default', '' );
[12033] Fix | Delete
$background_repeat = et_pb_responsive_options()->get_any_value( $this->props, "background_repeat{$suffix}", $background_repeat_default, ! $is_prev_background_image_active );
[12034] Fix | Delete
[12035] Fix | Delete
if ( '' !== $background_repeat ) {
[12036] Fix | Delete
$style .= sprintf(
[12037] Fix | Delete
'background-repeat: %1$s; ',
[12038] Fix | Delete
esc_html( $background_repeat )
[12039] Fix | Delete
);
[12040] Fix | Delete
}
[12041] Fix | Delete
[12042] Fix | Delete
// Blend.
[12043] Fix | Delete
$background_blend_default = self::$_->array_get( $this->fields_unprocessed, 'background_blend.default', '' );
[12044] Fix | Delete
$background_blend = et_pb_responsive_options()->get_any_value( $this->props, "background_blend{$suffix}", $background_blend_default, ! $is_prev_background_image_active );
[12045] Fix | Delete
$background_blend_inherit = et_pb_responsive_options()->get_any_value( $this->props, "background_blend{$suffix}", '', true );
[12046] Fix | Delete
[12047] Fix | Delete
if ( '' !== $background_blend_inherit ) {
[12048] Fix | Delete
// Don't print the same image blend style.
[12049] Fix | Delete
if ( '' !== $background_blend ) {
[12050] Fix | Delete
$style .= sprintf(
[12051] Fix | Delete
'background-blend-mode: %1$s; ',
[12052] Fix | Delete
esc_html( $background_blend )
[12053] Fix | Delete
);
[12054] Fix | Delete
}
[12055] Fix | Delete
[12056] Fix | Delete
// Reset - If background has image and gradient, force background-color: initial.
[12057] Fix | Delete
if ( $has_background_color_gradient && $has_background_image && $use_background_color_reset_options !== 'fields_only' && $background_blend_inherit !== $background_blend_default ) {
[12058] Fix | Delete
$has_background_gradient_and_image = true;
[12059] Fix | Delete
$background_color_style = 'initial';
[12060] Fix | Delete
$style .= sprintf( 'background-color: initial%1$s; ', esc_html( $important ) );
[12061] Fix | Delete
}
[12062] Fix | Delete
[12063] Fix | Delete
$processed_background_blend = $background_blend;
[12064] Fix | Delete
}
[12065] Fix | Delete
[12066] Fix | Delete
// Only append background image when the image is exist.
[12067] Fix | Delete
$background_images[] = sprintf( 'url(%1$s)', esc_html( $background_image ) );
[12068] Fix | Delete
} else if ( '' === $background_image ) {
[12069] Fix | Delete
// Reset - If background image is disabled, ensure we reset prev background blend mode.
[12070] Fix | Delete
if ( '' !== $processed_background_blend ) {
[12071] Fix | Delete
$style .= 'background-blend-mode: normal; ';
[12072] Fix | Delete
$processed_background_blend = '';
[12073] Fix | Delete
}
[12074] Fix | Delete
[12075] Fix | Delete
$is_background_image_disabled = true;
[12076] Fix | Delete
}
[12077] Fix | Delete
}
[12078] Fix | Delete
[12079] Fix | Delete
if ( ! empty( $background_images ) ) {
[12080] Fix | Delete
// The browsers stack the images in the opposite order to what you'd expect.
[12081] Fix | Delete
if ( 'on' !== $background_color_gradient_overlays_image ) {
[12082] Fix | Delete
$background_images = array_reverse( $background_images );
[12083] Fix | Delete
} else {
[12084] Fix | Delete
// Save gradient setting into property for later usage
[12085] Fix | Delete
if ( $this->save_processed_background ) {
[12086] Fix | Delete
et_()->array_set( $this->processed_background, "{$device}.gradient_overlays_image", true );
[12087] Fix | Delete
}
[12088] Fix | Delete
}
[12089] Fix | Delete
[12090] Fix | Delete
// Set background image styles only it's different compared to the larger device.
[12091] Fix | Delete
$background_image_style = join( ', ', $background_images );
[12092] Fix | Delete
if ( $processed_background_image !== $background_image_style ) {
[12093] Fix | Delete
$style .= sprintf(
[12094] Fix | Delete
'background-image: %1$s%2$s;',
[12095] Fix | Delete
esc_html( $background_image_style ),
[12096] Fix | Delete
$important
[12097] Fix | Delete
);
[12098] Fix | Delete
}
[12099] Fix | Delete
} else if ( ! $is_desktop && $is_background_color_gradient_disabled && $is_background_image_disabled ) {
[12100] Fix | Delete
// Reset - If background image and gradient are disabled, reset current background image.
[12101] Fix | Delete
$background_image_style = 'initial';
[12102] Fix | Delete
$style .= sprintf(
[12103] Fix | Delete
'background-image: %1$s%2$s;',
[12104] Fix | Delete
esc_html( $background_image_style ),
[12105] Fix | Delete
$important
[12106] Fix | Delete
);
[12107] Fix | Delete
}
[12108] Fix | Delete
[12109] Fix | Delete
// Save processed background images.
[12110] Fix | Delete
$processed_background_image = $background_image_style;
[12111] Fix | Delete
[12112] Fix | Delete
// C. Background Color.
[12113] Fix | Delete
if ( $use_background_color_options && 'fields_only' !== $use_background_color_options ) {
[12114] Fix | Delete
[12115] Fix | Delete
$use_background_color_value = et_pb_responsive_options()->get_any_value( $this->props, "use_background_color{$suffix}", 'on', true );
[12116] Fix | Delete
[12117] Fix | Delete
if ( ! $has_background_gradient_and_image && 'off' !== $use_background_color_value ) {
[12118] Fix | Delete
$background_color = et_pb_responsive_options()->get_inheritance_background_value( $this->props, 'background_color', $device, 'background', $this->fields_unprocessed );
[12119] Fix | Delete
$background_color = ! $is_desktop && '' === $background_color ? 'initial' : $background_color;
[12120] Fix | Delete
$background_color_style = $background_color;
[12121] Fix | Delete
[12122] Fix | Delete
if ( '' !== $background_color && $processed_background_color !== $background_color ) {
[12123] Fix | Delete
$style .= sprintf(
[12124] Fix | Delete
'background-color: %1$s%2$s; ',
[12125] Fix | Delete
esc_html( $background_color ),
[12126] Fix | Delete
esc_html( $important )
[12127] Fix | Delete
);
[12128] Fix | Delete
// If text module has background color set position to relative, as opposed to set text module as relative by default.
[12129] Fix | Delete
// Changing background selector to point to et_pb_text_inner will not render background correctly
[12130] Fix | Delete
// If position options are set they will override this value.
[12131] Fix | Delete
if ( 'et_pb_text' === $function_name ) {
[12132] Fix | Delete
$style .= 'position: relative; ';
[12133] Fix | Delete
}
[12134] Fix | Delete
}
[12135] Fix | Delete
} else if ( $has_background_color_toggle_options && 'off' === $use_background_color_value && ! $is_desktop ) {
[12136] Fix | Delete
// Reset - If current module has background color toggle, it's off, and current mode
[12137] Fix | Delete
// it's not desktop, we should reset the background color.
[12138] Fix | Delete
$style .= sprintf(
[12139] Fix | Delete
'background-color: initial %1$s; ',
[12140] Fix | Delete
esc_html( $important )
[12141] Fix | Delete
);
[12142] Fix | Delete
}
[12143] Fix | Delete
}
[12144] Fix | Delete
[12145] Fix | Delete
// Save processed background color.
[12146] Fix | Delete
$processed_background_color = $background_color_style;
[12147] Fix | Delete
[12148] Fix | Delete
// Render background styles.
[12149] Fix | Delete
if ( '' !== $style ) {
[12150] Fix | Delete
// Add media query parameter.
[12151] Fix | Delete
$background_args = array();
[12152] Fix | Delete
if ( ! $is_desktop ) {
[12153] Fix | Delete
$current_media_query = 'tablet' === $device ? 'max_width_980' : 'max_width_767';
[12154] Fix | Delete
$background_args['media_query'] = ET_Builder_Element::get_media_query( $current_media_query );
[12155] Fix | Delete
}
[12156] Fix | Delete
[12157] Fix | Delete
$css_element = ! empty( $settings['css']['main'] ) ? $settings['css']['main'] : $this->main_css_element;
[12158] Fix | Delete
[12159] Fix | Delete
self::set_style( $function_name, wp_parse_args( $background_args, array(
[12160] Fix | Delete
'selector' => $css_element,
[12161] Fix | Delete
'declaration' => rtrim( $style ),
[12162] Fix | Delete
'priority' => $this->_style_priority,
[12163] Fix | Delete
) ) );
[12164] Fix | Delete
}
[12165] Fix | Delete
}
[12166] Fix | Delete
[12167] Fix | Delete
// Background Hover.
[12168] Fix | Delete
if ( et_builder_is_hover_enabled( 'background', $this->props ) ) {
[12169] Fix | Delete
$background_images_hover = array();
[12170] Fix | Delete
$style_hover = '';
[12171] Fix | Delete
[12172] Fix | Delete
$has_background_color_gradient_hover = false;
[12173] Fix | Delete
$has_background_image_hover = false;
[12174] Fix | Delete
$has_background_gradient_and_image_hover = false;
[12175] Fix | Delete
$is_background_color_gradient_hover_disabled = false;
[12176] Fix | Delete
$is_background_image_hover_disabled = false;
[12177] Fix | Delete
[12178] Fix | Delete
$background_color_gradient_overlays_image_hover = 'off';
[12179] Fix | Delete
[12180] Fix | Delete
// Background Gradient Hover.
[12181] Fix | Delete
// This part is little bit different compared to other hover implementation. In this case,
[12182] Fix | Delete
// hover is enabled on the background field, not on the each of those fields. So, built
[12183] Fix | Delete
// in function get_value() doesn't work in this case. Temporarily, we need to fetch the
[12184] Fix | Delete
// the value from get_raw_value().
[12185] Fix | Delete
if ( $use_background_color_gradient_options && 'fields_only' !== $use_background_color_gradient_options ) {
[12186] Fix | Delete
$use_background_color_gradient_hover = et_pb_responsive_options()->get_inheritance_background_value( $this->props, 'use_background_color_gradient', 'hover', 'background', $this->fields_unprocessed );
[12187] Fix | Delete
[12188] Fix | Delete
// 1. Ensure gradient color is active and values are not null.
[12189] Fix | Delete
if ( 'on' === $use_background_color_gradient_hover ) {
[12190] Fix | Delete
// Desktop value as default.
[12191] Fix | Delete
$background_color_gradient_type_desktop = self::$_->array_get( $gradient_properties_desktop, 'type', '' );
[12192] Fix | Delete
$background_color_gradient_direction_desktop = self::$_->array_get( $gradient_properties_desktop, 'direction', '' );
[12193] Fix | Delete
$background_color_gradient_radial_direction_desktop = self::$_->array_get( $gradient_properties_desktop, 'radial_direction', '' );
[12194] Fix | Delete
$background_color_gradient_color_start_desktop = self::$_->array_get( $gradient_properties_desktop, 'color_start', '' );
[12195] Fix | Delete
$background_color_gradient_color_end_desktop = self::$_->array_get( $gradient_properties_desktop, 'color_end', '' );
[12196] Fix | Delete
$background_color_gradient_start_position_desktop = self::$_->array_get( $gradient_properties_desktop, 'start_position', '' );
[12197] Fix | Delete
$background_color_gradient_end_position_desktop = self::$_->array_get( $gradient_properties_desktop, 'end_position', '' );
[12198] Fix | Delete
[12199] Fix | Delete
// Hover value.
[12200] Fix | Delete
$background_color_gradient_type_hover = et_pb_hover_options()->get_raw_value( 'background_color_gradient_type', $this->props, $background_color_gradient_type_desktop );
[12201] Fix | Delete
$background_color_gradient_direction_hover = et_pb_hover_options()->get_raw_value( 'background_color_gradient_direction', $this->props, $background_color_gradient_direction_desktop );
[12202] Fix | Delete
$background_color_gradient_direction_radial_hover = et_pb_hover_options()->get_raw_value( 'background_color_gradient_direction_radial', $this->props, $background_color_gradient_radial_direction_desktop );
[12203] Fix | Delete
$background_color_gradient_start_hover = et_pb_hover_options()->get_raw_value( 'background_color_gradient_start', $this->props, $background_color_gradient_color_start_desktop );
[12204] Fix | Delete
$background_color_gradient_end_hover = et_pb_hover_options()->get_raw_value( 'background_color_gradient_end', $this->props, $background_color_gradient_color_end_desktop );
[12205] Fix | Delete
$background_color_gradient_start_position_hover = et_pb_hover_options()->get_raw_value( 'background_color_gradient_start_position', $this->props, $background_color_gradient_start_position_desktop );
[12206] Fix | Delete
$background_color_gradient_end_position_hover = et_pb_hover_options()->get_raw_value( 'background_color_gradient_end_position', $this->props, $background_color_gradient_end_position_desktop );
[12207] Fix | Delete
$background_color_gradient_overlays_image_hover = et_pb_hover_options()->get_raw_value( 'background_color_gradient_overlays_image', $this->props, $background_color_gradient_overlays_image_desktop );
[12208] Fix | Delete
[12209] Fix | Delete
// Flag to inform BG Color if current module has Gradient.
[12210] Fix | Delete
$has_background_color_gradient_hover = true;
[12211] Fix | Delete
[12212] Fix | Delete
$gradient_values_hover = array(
[12213] Fix | Delete
'type' => '' !== $background_color_gradient_type_hover ? $background_color_gradient_type_hover : $background_color_gradient_type_desktop,
[12214] Fix | Delete
'direction' => '' !== $background_color_gradient_direction_hover ? $background_color_gradient_direction_hover : $background_color_gradient_direction_desktop,
[12215] Fix | Delete
'radial_direction' => '' !== $background_color_gradient_direction_radial_hover ? $background_color_gradient_direction_radial_hover : $background_color_gradient_radial_direction_desktop,
[12216] Fix | Delete
'color_start' => '' !== $background_color_gradient_start_hover ? $background_color_gradient_start_hover : $background_color_gradient_color_start_desktop,
[12217] Fix | Delete
'color_end' => '' !== $background_color_gradient_end_hover ? $background_color_gradient_end_hover : $background_color_gradient_color_end_desktop,
[12218] Fix | Delete
'start_position' => '' !== $background_color_gradient_start_position_hover ? $background_color_gradient_start_position_hover : $background_color_gradient_start_position_desktop,
[12219] Fix | Delete
'end_position' => '' !== $background_color_gradient_end_position_hover ? $background_color_gradient_end_position_hover : $background_color_gradient_end_position_desktop,
[12220] Fix | Delete
);
[12221] Fix | Delete
[12222] Fix | Delete
$background_gradient_hover = $this->get_gradient( $gradient_values_hover );
[12223] Fix | Delete
[12224] Fix | Delete
$background_images_hover[] = $background_gradient_hover;
[12225] Fix | Delete
[12226] Fix | Delete
// Save resulted gradient into property for later usage
[12227] Fix | Delete
if ( $this->save_processed_background ) {
[12228] Fix | Delete
et_()->array_set( $this->processed_background, "hover.gradient", $background_gradient_hover );
[12229] Fix | Delete
}
[12230] Fix | Delete
} else if ( 'off' === $use_background_color_gradient_hover ) {
[12231] Fix | Delete
$is_background_color_gradient_hover_disabled = true;
[12232] Fix | Delete
}
[12233] Fix | Delete
}
[12234] Fix | Delete
[12235] Fix | Delete
// Background Image Hover.
[12236] Fix | Delete
// This part is little bit different compared to other hover implementation. In this case,
[12237] Fix | Delete
// hover is enabled on the background field, not on the each of those fields. So, built
[12238] Fix | Delete
// in function get_value() doesn't work in this case. Temporarily, we need to fetch the
[12239] Fix | Delete
// the value from get_raw_value().
[12240] Fix | Delete
if ( $use_background_image_options && 'fields_only' !== $use_background_image_options ) {
[12241] Fix | Delete
$background_image_hover = et_pb_responsive_options()->get_inheritance_background_value( $this->props, 'background_image', 'hover', 'background', $this->fields_unprocessed );
[12242] Fix | Delete
$parallax_hover = et_pb_hover_options()->get_raw_value( 'parallax', $this->props );
[12243] Fix | Delete
[12244] Fix | Delete
// Featured image as background is in higher priority.
[12245] Fix | Delete
if ( $this->featured_image_background ) {
[12246] Fix | Delete
$featured_image = self::$_->array_get( $this->props, 'featured_image', '' );
[12247] Fix | Delete
$featured_placement = self::$_->array_get( $this->props, 'featured_placement', '' );
[12248] Fix | Delete
$featured_image_src_obj = wp_get_attachment_image_src( get_post_thumbnail_id( self::_get_main_post_id() ), 'full' );
[12249] Fix | Delete
$featured_image_src = isset( $featured_image_src_obj[0] ) ? $featured_image_src_obj[0] : '';
[12250] Fix | Delete
[12251] Fix | Delete
if ( 'on' === $featured_image && 'background' === $featured_placement && '' !== $featured_image_src ) {
[12252] Fix | Delete
$background_image = $featured_image_src;
[12253] Fix | Delete
}
[12254] Fix | Delete
}
[12255] Fix | Delete
[12256] Fix | Delete
if ( '' !== $background_image_hover && null !== $background_image_hover && 'on' !== $parallax_hover ) {
[12257] Fix | Delete
// Flag to inform BG Color if current module has Image.
[12258] Fix | Delete
$has_background_image_hover = true;
[12259] Fix | Delete
[12260] Fix | Delete
// Size.
[12261] Fix | Delete
$background_size_hover = et_pb_hover_options()->get_raw_value( 'background_size', $this->props );
[12262] Fix | Delete
$background_size_desktop = self::$_->array_get( $this->props, 'background_size', '' );
[12263] Fix | Delete
$is_same_background_size = $background_size_hover === $background_size_desktop;
[12264] Fix | Delete
if ( empty( $background_size_hover ) && ! empty( $background_size_desktop ) ) {
[12265] Fix | Delete
$background_size_hover = $background_size_desktop;
[12266] Fix | Delete
}
[12267] Fix | Delete
[12268] Fix | Delete
if ( ! empty( $background_size_hover ) && ! $is_same_background_size ) {
[12269] Fix | Delete
$style_hover .= sprintf(
[12270] Fix | Delete
'background-size: %1$s; ',
[12271] Fix | Delete
esc_html( $background_size_hover )
[12272] Fix | Delete
);
[12273] Fix | Delete
}
[12274] Fix | Delete
[12275] Fix | Delete
// Position.
[12276] Fix | Delete
$background_position_hover = et_pb_hover_options()->get_raw_value( 'background_position', $this->props );
[12277] Fix | Delete
$background_position_desktop = self::$_->array_get( $this->props, 'background_position', '' );
[12278] Fix | Delete
$is_same_background_position = $background_position_hover === $background_position_desktop;
[12279] Fix | Delete
if ( empty( $background_position_hover ) && ! empty( $background_position_desktop ) ) {
[12280] Fix | Delete
$background_position_hover = $background_position_desktop;
[12281] Fix | Delete
}
[12282] Fix | Delete
[12283] Fix | Delete
if ( ! empty( $background_position_hover ) && ! $is_same_background_position ) {
[12284] Fix | Delete
$style_hover .= sprintf(
[12285] Fix | Delete
'background-position: %1$s; ',
[12286] Fix | Delete
esc_html( str_replace( '_', ' ', $background_position_hover ) )
[12287] Fix | Delete
);
[12288] Fix | Delete
}
[12289] Fix | Delete
[12290] Fix | Delete
// Repeat.
[12291] Fix | Delete
$background_repeat_hover = et_pb_hover_options()->get_raw_value( 'background_repeat', $this->props );
[12292] Fix | Delete
$background_repeat_desktop = self::$_->array_get( $this->props, 'background_repeat', '' );
[12293] Fix | Delete
$is_same_background_repeat = $background_repeat_hover === $background_repeat_desktop;
[12294] Fix | Delete
if ( empty( $background_repeat_hover ) && ! empty( $background_repeat_desktop ) ) {
[12295] Fix | Delete
$background_repeat_hover = $background_repeat_desktop;
[12296] Fix | Delete
}
[12297] Fix | Delete
[12298] Fix | Delete
if ( ! empty( $background_repeat_hover ) && ! $is_same_background_repeat ) {
[12299] Fix | Delete
$style_hover .= sprintf(
[12300] Fix | Delete
'background-repeat: %1$s; ',
[12301] Fix | Delete
esc_html( $background_repeat_hover )
[12302] Fix | Delete
);
[12303] Fix | Delete
}
[12304] Fix | Delete
[12305] Fix | Delete
// Blend.
[12306] Fix | Delete
$background_blend_hover = et_pb_hover_options()->get_raw_value( 'background_blend', $this->props );
[12307] Fix | Delete
$background_blend_default = self::$_->array_get( $this->fields_unprocessed, 'background_blend.default', '' );
[12308] Fix | Delete
$background_blend_desktop = self::$_->array_get( $this->props, 'background_blend', '' );
[12309] Fix | Delete
$is_same_background_blend = $background_blend_hover === $background_blend_desktop;
[12310] Fix | Delete
[12311] Fix | Delete
if ( empty( $background_blend_hover ) && ! empty( $background_blend_desktop ) ) {
[12312] Fix | Delete
$background_blend_hover = $background_blend_desktop;
[12313] Fix | Delete
}
[12314] Fix | Delete
[12315] Fix | Delete
if ( ! empty( $background_blend_hover ) ) {
[12316] Fix | Delete
// Don't print the same background blend.
[12317] Fix | Delete
if ( ! $is_same_background_blend ) {
[12318] Fix | Delete
$style_hover .= sprintf(
[12319] Fix | Delete
'background-blend-mode: %1$s; ',
[12320] Fix | Delete
esc_html( $background_blend_hover )
[12321] Fix | Delete
);
[12322] Fix | Delete
}
[12323] Fix | Delete
[12324] Fix | Delete
// Force background-color: initial;
[12325] Fix | Delete
if ( $has_background_color_gradient_hover && $has_background_image_hover && $background_blend_hover !== $background_blend_default ) {
[12326] Fix | Delete
$has_background_gradient_and_image_hover = true;
[12327] Fix | Delete
$style_hover .= sprintf( 'background-color: initial%1$s; ', esc_html( $important ) );
[12328] Fix | Delete
}
[12329] Fix | Delete
}
[12330] Fix | Delete
[12331] Fix | Delete
// Only append background image when the image is exist.
[12332] Fix | Delete
$background_images_hover[] = sprintf( 'url(%1$s)', esc_html( $background_image_hover ) );
[12333] Fix | Delete
} else if ( '' === $background_image_hover ) {
[12334] Fix | Delete
$is_background_image_hover_disabled = true;
[12335] Fix | Delete
}
[12336] Fix | Delete
}
[12337] Fix | Delete
[12338] Fix | Delete
if ( ! empty( $background_images_hover ) ) {
[12339] Fix | Delete
// The browsers stack the images in the opposite order to what you'd expect.
[12340] Fix | Delete
if ( 'on' !== $background_color_gradient_overlays_image_hover ) {
[12341] Fix | Delete
$background_images_hover = array_reverse( $background_images_hover );
[12342] Fix | Delete
} else {
[12343] Fix | Delete
// Save gradient setting into property for later usage
[12344] Fix | Delete
if ( $this->save_processed_background ) {
[12345] Fix | Delete
et_()->array_set( $this->processed_background, "hover.gradient_overlays_image", true );
[12346] Fix | Delete
}
[12347] Fix | Delete
}
[12348] Fix | Delete
[12349] Fix | Delete
$style_hover .= sprintf(
[12350] Fix | Delete
'background-image: %1$s%2$s;',
[12351] Fix | Delete
esc_html( join( ', ', $background_images_hover ) ),
[12352] Fix | Delete
$important
[12353] Fix | Delete
);
[12354] Fix | Delete
} else if ( $is_background_color_gradient_hover_disabled && $is_background_image_hover_disabled ) {
[12355] Fix | Delete
$style_hover .= sprintf(
[12356] Fix | Delete
'background-image: initial %1$s;',
[12357] Fix | Delete
$important
[12358] Fix | Delete
);
[12359] Fix | Delete
}
[12360] Fix | Delete
[12361] Fix | Delete
// Background Color Hover.
[12362] Fix | Delete
if ( $use_background_color_options && 'fields_only' !== $use_background_color_options ) {
[12363] Fix | Delete
[12364] Fix | Delete
$use_background_color_hover_value = self::$_->array_get( $this->props, 'use_background_color__hover', '' );
[12365] Fix | Delete
$use_background_color_hover_value = ! empty( $use_background_color_hover_value ) ? $use_background_color_hover_value : self::$_->array_get( $this->props, 'use_background_color', 'on' );
[12366] Fix | Delete
[12367] Fix | Delete
if ( ! $has_background_gradient_and_image_hover && 'off' !== $use_background_color_hover_value ) {
[12368] Fix | Delete
$background_color_hover = et_pb_responsive_options()->get_inheritance_background_value( $this->props, 'background_color', 'hover', 'background', $this->fields_unprocessed );
[12369] Fix | Delete
$background_color_hover = '' !== $background_color_hover ? $background_color_hover : 'transparent';
[12370] Fix | Delete
[12371] Fix | Delete
if ( '' !== $background_color_hover ) {
[12372] Fix | Delete
$style_hover .= sprintf(
[12373] Fix | Delete
'background-color: %1$s%2$s; ',
[12374] Fix | Delete
esc_html( $background_color_hover ),
[12375] Fix | Delete
esc_html( $important )
[12376] Fix | Delete
);
[12377] Fix | Delete
}
[12378] Fix | Delete
} else if ( $has_background_color_toggle_options && 'off' === $use_background_color_hover_value ) {
[12379] Fix | Delete
// Reset - If current module has background color toggle, it's off, and current mode
[12380] Fix | Delete
// it's not desktop, we should reset the background color.
[12381] Fix | Delete
$style .= sprintf(
[12382] Fix | Delete
'background-color: initial %1$s; ',
[12383] Fix | Delete
esc_html( $important )
[12384] Fix | Delete
);
[12385] Fix | Delete
}
[12386] Fix | Delete
}
[12387] Fix | Delete
[12388] Fix | Delete
// Render background hover styles.
[12389] Fix | Delete
if ( '' !== $style_hover ) {
[12390] Fix | Delete
$css_element_main = self::$_->array_get( $settings, 'css.main', $this->main_css_element );
[12391] Fix | Delete
$css_element_hover = self::$_->array_get( $settings, 'css.hover', et_pb_hover_options()->add_hover_to_order_class( $css_element_main ) );
[12392] Fix | Delete
[12393] Fix | Delete
self::set_style( $function_name, array(
[12394] Fix | Delete
'selector' => $css_element_hover,
[12395] Fix | Delete
'declaration' => rtrim( $style_hover ),
[12396] Fix | Delete
'priority' => $this->_style_priority,
[12397] Fix | Delete
) );
[12398] Fix | Delete
}
[12399] Fix | Delete
}
[12400] Fix | Delete
}
[12401] Fix | Delete
[12402] Fix | Delete
/**
[12403] Fix | Delete
* Process advanced text options.
[12404] Fix | Delete
*
[12405] Fix | Delete
* @since 3.23 Add support to generate responsive styles of text orientation.
[12406] Fix | Delete
*
[12407] Fix | Delete
* @param string $function_name Module slug.
[12408] Fix | Delete
*/
[12409] Fix | Delete
function process_advanced_text_options( $function_name ) {
[12410] Fix | Delete
// Disable if module doesn't set advanced_fields property and has no VB support
[12411] Fix | Delete
if ( ! $this->has_vb_support() && ! $this->has_advanced_fields ) {
[12412] Fix | Delete
return;
[12413] Fix | Delete
}
[12414] Fix | Delete
[12415] Fix | Delete
if ( ! self::$_->array_get( $this->advanced_fields, 'text', false ) ) {
[12416] Fix | Delete
return;
[12417] Fix | Delete
}
[12418] Fix | Delete
[12419] Fix | Delete
$text_options = $this->advanced_fields['text'];
[12420] Fix | Delete
[12421] Fix | Delete
if ( isset( $text_options['css'] ) && is_array( $text_options['css'] ) ) {
[12422] Fix | Delete
$text_css = $text_options['css'];
[12423] Fix | Delete
$text_orientation_default = isset( $this->fields_unprocessed['text_orientation']['default'] ) ? $this->fields_unprocessed['text_orientation']['default'] : '';
[12424] Fix | Delete
$text_orientation = $this->get_text_orientation() !== $text_orientation_default ? $this->get_text_orientation() : '';
[12425] Fix | Delete
$text_orientation_tablet = $this->get_text_orientation( 'tablet', $text_orientation_default );
[12426] Fix | Delete
$text_orientation_phone = $this->get_text_orientation( 'phone', $text_orientation_default );
[12427] Fix | Delete
[12428] Fix | Delete
// Normally, text orientation attr adds et_pb_text_align_* class name to its module wrapper
[12429] Fix | Delete
// In some cases, it needs to target particular children inside the module. Thus, only prints
[12430] Fix | Delete
// styling if selector is given
[12431] Fix | Delete
if ( isset( $text_css['text_orientation'] ) ) {
[12432] Fix | Delete
$text_orientation_values = array(
[12433] Fix | Delete
'desktop' => esc_attr( $text_orientation ),
[12434] Fix | Delete
'tablet' => esc_attr( $text_orientation_tablet ),
[12435] Fix | Delete
'phone' => esc_attr( $text_orientation_phone ),
[12436] Fix | Delete
);
[12437] Fix | Delete
[12438] Fix | Delete
et_pb_responsive_options()->generate_responsive_css( $text_orientation_values, $text_css['text_orientation'], 'text-align', $function_name, '', 'alignment', $this->_style_priority );
[12439] Fix | Delete
}
[12440] Fix | Delete
}
[12441] Fix | Delete
}
[12442] Fix | Delete
[12443] Fix | Delete
/**
[12444] Fix | Delete
* Output border and border radius styling
[12445] Fix | Delete
*
[12446] Fix | Delete
* @since 3.23 Add support to generate responsive styles of border styles and radii.]
[12447] Fix | Delete
*/
[12448] Fix | Delete
function process_advanced_borders_options( $function_name ) {
[12449] Fix | Delete
// Disable if module doesn't set advanced_fields property and has no VB support
[12450] Fix | Delete
if ( ! $this->has_vb_support() && ! $this->has_advanced_fields ) {
[12451] Fix | Delete
return;
[12452] Fix | Delete
}
[12453] Fix | Delete
[12454] Fix | Delete
global $et_fb_processing_shortcode_object;
[12455] Fix | Delete
[12456] Fix | Delete
$borders = self::$_->array_get( $this->advanced_fields, 'borders', array( 'default' => array() ) );
[12457] Fix | Delete
$border_field = ET_Builder_Module_Fields_Factory::get( 'Border' );
[12458] Fix | Delete
[12459] Fix | Delete
if ( is_array( $borders ) && ! empty( $borders ) ) {
[12460] Fix | Delete
foreach ( $borders as $border_name => $border ) {
[12461] Fix | Delete
// Enable module to disable border options
[12462] Fix | Delete
if ( false === $border ) {
[12463] Fix | Delete
continue;
[12464] Fix | Delete
}
[12465] Fix | Delete
[12466] Fix | Delete
// Blurb image specific adjustment
[12467] Fix | Delete
if ( 'image' === $border_name && 'et_pb_blurb' === $this->slug && 'on' === self::$_->array_get( $this->props, 'use_icon' ) ) {
[12468] Fix | Delete
continue;
[12469] Fix | Delete
}
[12470] Fix | Delete
[12471] Fix | Delete
// Blog specific adjustment
[12472] Fix | Delete
if ( 'fullwidth' === $border_name && 'et_pb_blog' === $this->slug && 'on' !== self::$_->array_get( $this->props, 'fullwidth' ) ) {
[12473] Fix | Delete
continue;
[12474] Fix | Delete
}
[12475] Fix | Delete
[12476] Fix | Delete
// Login & signup specific adjustment
[12477] Fix | Delete
if ( 'fields_focus' === $border_name && in_array( $this->slug, array( 'et_pb_login', 'et_pb_signup' ) ) && 'on' !== self::$_->array_get( $this->props, 'use_focus_border_color' ) ) {
[12478] Fix | Delete
continue;
[12479] Fix | Delete
}
[12480] Fix | Delete
[12481] Fix | Delete
// Check field visibility against its dependency
[12482] Fix | Delete
if ( ! $this->_is_field_applicable( $border ) ) {
[12483] Fix | Delete
continue;
[12484] Fix | Delete
}
[12485] Fix | Delete
[12486] Fix | Delete
$is_border_default = 'default' === $border_name;
[12487] Fix | Delete
[12488] Fix | Delete
$suffix = $is_border_default ? '' : "_{$border_name}";
[12489] Fix | Delete
[12490] Fix | Delete
if ( $is_border_default && $this->slug !== $function_name ) {
[12491] Fix | Delete
// This module's shortcode callback is being used to render another module (like accordion item
[12492] Fix | Delete
// uses toggle ) so we need to make sure border option overrides are taken from the other module
[12493] Fix | Delete
// instead of this one.
[12494] Fix | Delete
$fields = self::get_advanced_fields( $this->get_post_type(), 'all', $function_name );
[12495] Fix | Delete
$border = self::$_->array_get( $fields, 'advanced_common.border', array() );
[12496] Fix | Delete
}
[12497] Fix | Delete
[12498] Fix | Delete
// Backward compatibility. For 3rd party modules which define `_add_additional_border_fields` and do not have `process_advanced_border_options`
[12499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function