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
File: main-structure-elements.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Fires before the builder's structure element classes are loaded.
[2] Fix | Delete
*
[3] Fix | Delete
* @since 4.4.9
[4] Fix | Delete
*/
[5] Fix | Delete
do_action( 'et_builder_structure_elements_load' );
[6] Fix | Delete
[7] Fix | Delete
/**
[8] Fix | Delete
* Section Element class
[9] Fix | Delete
*
[10] Fix | Delete
* @since [version]
[11] Fix | Delete
*/
[12] Fix | Delete
class ET_Builder_Section extends ET_Builder_Structure_Element {
[13] Fix | Delete
function init() {
[14] Fix | Delete
$this->name = esc_html__( 'Section', 'et_builder' );
[15] Fix | Delete
$this->plural = esc_html__( 'Sections', 'et_builder' );
[16] Fix | Delete
$this->slug = 'et_pb_section';
[17] Fix | Delete
$this->vb_support = 'on';
[18] Fix | Delete
[19] Fix | Delete
$this->settings_modal_toggles = array(
[20] Fix | Delete
'general' => array(
[21] Fix | Delete
'toggles' => array(
[22] Fix | Delete
'background' => array(
[23] Fix | Delete
'title' => et_builder_i18n( 'Background' ),
[24] Fix | Delete
'sub_toggles' => array(
[25] Fix | Delete
'main' => '',
[26] Fix | Delete
'column_1' => array( 'name' => esc_html__( 'Column 1', 'et_builder' ) ),
[27] Fix | Delete
'column_2' => array( 'name' => esc_html__( 'Column 2', 'et_builder' ) ),
[28] Fix | Delete
'column_3' => array( 'name' => esc_html__( 'Column 3', 'et_builder' ) ),
[29] Fix | Delete
),
[30] Fix | Delete
'priority' => 80,
[31] Fix | Delete
),
[32] Fix | Delete
),
[33] Fix | Delete
),
[34] Fix | Delete
'advanced' => array(
[35] Fix | Delete
'toggles' => array(
[36] Fix | Delete
'layout' => et_builder_i18n( 'Layout' ),
[37] Fix | Delete
'width' => array(
[38] Fix | Delete
'title' => et_builder_i18n( 'Sizing' ),
[39] Fix | Delete
'priority' => 65,
[40] Fix | Delete
),
[41] Fix | Delete
'margin_padding' => array(
[42] Fix | Delete
'title' => esc_html__( 'Spacing', 'et_builder' ),
[43] Fix | Delete
'sub_toggles' => array(
[44] Fix | Delete
'main' => '',
[45] Fix | Delete
'column_1' => array( 'name' => esc_html__( 'Column 1', 'et_builder' ) ),
[46] Fix | Delete
'column_2' => array( 'name' => esc_html__( 'Column 2', 'et_builder' ) ),
[47] Fix | Delete
'column_3' => array( 'name' => esc_html__( 'Column 3', 'et_builder' ) ),
[48] Fix | Delete
),
[49] Fix | Delete
'priority' => 70,
[50] Fix | Delete
),
[51] Fix | Delete
),
[52] Fix | Delete
),
[53] Fix | Delete
'custom_css' => array(
[54] Fix | Delete
'toggles' => array(
[55] Fix | Delete
'classes' => array(
[56] Fix | Delete
'title' => esc_html__( 'CSS ID & Classes', 'et_builder' ),
[57] Fix | Delete
'sub_toggles' => array(
[58] Fix | Delete
'main' => '',
[59] Fix | Delete
'column_1' => array( 'name' => esc_html__( 'Column 1', 'et_builder' ) ),
[60] Fix | Delete
'column_2' => array( 'name' => esc_html__( 'Column 2', 'et_builder' ) ),
[61] Fix | Delete
'column_3' => array( 'name' => esc_html__( 'Column 3', 'et_builder' ) ),
[62] Fix | Delete
),
[63] Fix | Delete
),
[64] Fix | Delete
'custom_css' => array(
[65] Fix | Delete
'title' => et_builder_i18n( 'Custom CSS' ),
[66] Fix | Delete
'sub_toggles' => array(
[67] Fix | Delete
'main' => '',
[68] Fix | Delete
'column_1' => array( 'name' => esc_html__( 'Column 1', 'et_builder' ) ),
[69] Fix | Delete
'column_2' => array( 'name' => esc_html__( 'Column 2', 'et_builder' ) ),
[70] Fix | Delete
'column_3' => array( 'name' => esc_html__( 'Column 3', 'et_builder' ) ),
[71] Fix | Delete
),
[72] Fix | Delete
),
[73] Fix | Delete
),
[74] Fix | Delete
),
[75] Fix | Delete
);
[76] Fix | Delete
[77] Fix | Delete
$this->advanced_fields = array(
[78] Fix | Delete
'background' => array(
[79] Fix | Delete
'use_background_color' => 'fields_only',
[80] Fix | Delete
'use_background_image' => true,
[81] Fix | Delete
'use_background_color_gradient' => true,
[82] Fix | Delete
'use_background_video' => true,
[83] Fix | Delete
'use_background_color_reset' => 'fields_only',
[84] Fix | Delete
'css' => array(
[85] Fix | Delete
'important' => 'all',
[86] Fix | Delete
'main' => 'div.et_pb_section%%order_class%%',
[87] Fix | Delete
),
[88] Fix | Delete
'options' => array(
[89] Fix | Delete
'background_color' => array(
[90] Fix | Delete
'default' => '',
[91] Fix | Delete
'hover' => 'tabs',
[92] Fix | Delete
),
[93] Fix | Delete
'allow_player_pause' => array(
[94] Fix | Delete
'default_on_front' => 'off',
[95] Fix | Delete
),
[96] Fix | Delete
'background_video_pause_outside_viewport' => array(
[97] Fix | Delete
'default_on_front' => 'on',
[98] Fix | Delete
),
[99] Fix | Delete
'parallax' => array(
[100] Fix | Delete
'default_on_front' => 'off',
[101] Fix | Delete
),
[102] Fix | Delete
'parallax_method' => array(
[103] Fix | Delete
'default_on_front' => 'on',
[104] Fix | Delete
),
[105] Fix | Delete
),
[106] Fix | Delete
),
[107] Fix | Delete
'max_width' => array(
[108] Fix | Delete
'css' => array(
[109] Fix | Delete
'module_alignment' => '%%order_class%%',
[110] Fix | Delete
),
[111] Fix | Delete
'options' => array(
[112] Fix | Delete
'module_alignment' => array(
[113] Fix | Delete
'label' => esc_html__( 'Section Alignment', 'et_builder' ),
[114] Fix | Delete
),
[115] Fix | Delete
),
[116] Fix | Delete
'extra' => array(
[117] Fix | Delete
'inner' => array(
[118] Fix | Delete
'css' => array(
[119] Fix | Delete
'main' => array( '%%order_class%% > .et_pb_row', '%%order_class%%.et_section_specialty > .et_pb_row' ),
[120] Fix | Delete
),
[121] Fix | Delete
'options' => array(
[122] Fix | Delete
'width' => array(
[123] Fix | Delete
'label' => esc_html__( 'Inner Width', 'et_builder' ),
[124] Fix | Delete
'depends_show_if' => 'on',
[125] Fix | Delete
'specialty_only' => 'yes',
[126] Fix | Delete
),
[127] Fix | Delete
'max_width' => array(
[128] Fix | Delete
'label' => esc_html__( 'Inner Max Width', 'et_builder' ),
[129] Fix | Delete
'depends_show_if' => 'on',
[130] Fix | Delete
'specialty_only' => 'yes',
[131] Fix | Delete
),
[132] Fix | Delete
'module_alignment' => array(
[133] Fix | Delete
'label' => esc_html__( 'Row Alignment', 'et_builder' ),
[134] Fix | Delete
'depends_show_if' => 'on',
[135] Fix | Delete
'specialty_only' => 'yes',
[136] Fix | Delete
),
[137] Fix | Delete
)
[138] Fix | Delete
)
[139] Fix | Delete
)
[140] Fix | Delete
),
[141] Fix | Delete
'fonts' => false,
[142] Fix | Delete
'text' => false,
[143] Fix | Delete
'button' => false,
[144] Fix | Delete
'position_fields' => array(
[145] Fix | Delete
'default' => 'relative',
[146] Fix | Delete
),
[147] Fix | Delete
);
[148] Fix | Delete
[149] Fix | Delete
$this->help_videos = array(
[150] Fix | Delete
array(
[151] Fix | Delete
'id' => '3kmJ_mMVB1w',
[152] Fix | Delete
'name' => esc_html__( 'An introduction to Sections', 'et_builder' ),
[153] Fix | Delete
),
[154] Fix | Delete
);
[155] Fix | Delete
}
[156] Fix | Delete
[157] Fix | Delete
function get_fields() {
[158] Fix | Delete
$fields = array(
[159] Fix | Delete
'inner_shadow' => array(
[160] Fix | Delete
'label' => esc_html__( 'Show Inner Shadow', 'et_builder' ),
[161] Fix | Delete
'type' => 'yes_no_button',
[162] Fix | Delete
'option_category' => 'configuration',
[163] Fix | Delete
'options' => array(
[164] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[165] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[166] Fix | Delete
),
[167] Fix | Delete
'default' => 'off',
[168] Fix | Delete
'description' => esc_html__( 'Here you can select whether or not your section has an inner shadow. This can look great when you have colored backgrounds or background images.', 'et_builder' ),
[169] Fix | Delete
'tab_slug' => 'advanced',
[170] Fix | Delete
'toggle_slug' => 'layout',
[171] Fix | Delete
'default_on_front'=> 'off',
[172] Fix | Delete
),
[173] Fix | Delete
'make_equal' => array(
[174] Fix | Delete
'label' => esc_html__( 'Equalize Column Heights', 'et_builder' ),
[175] Fix | Delete
'description' => esc_html__( 'Equalizing column heights will force all columns to assume the height of the tallest column in the row. All columns will have the same height, keeping their appearance uniform.', 'et_builder' ),
[176] Fix | Delete
'type' => 'yes_no_button',
[177] Fix | Delete
'option_category' => 'layout',
[178] Fix | Delete
'options' => array(
[179] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[180] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[181] Fix | Delete
),
[182] Fix | Delete
'default' => 'off',
[183] Fix | Delete
'tab_slug' => 'advanced',
[184] Fix | Delete
'toggle_slug' => 'width',
[185] Fix | Delete
'specialty_only' => 'yes',
[186] Fix | Delete
),
[187] Fix | Delete
'use_custom_gutter' => array(
[188] Fix | Delete
'label' => esc_html__( 'Use Custom Gutter Width', 'et_builder' ),
[189] Fix | Delete
'description' => esc_html__( 'Enable this option to define custom gutter width for this section.', 'et_builder' ),
[190] Fix | Delete
'type' => 'yes_no_button',
[191] Fix | Delete
'option_category' => 'layout',
[192] Fix | Delete
'options' => array(
[193] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[194] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[195] Fix | Delete
),
[196] Fix | Delete
'default' => 'off',
[197] Fix | Delete
'affects' => array(
[198] Fix | Delete
'gutter_width',
[199] Fix | Delete
),
[200] Fix | Delete
'tab_slug' => 'advanced',
[201] Fix | Delete
'toggle_slug' => 'width',
[202] Fix | Delete
'specialty_only' => 'yes',
[203] Fix | Delete
),
[204] Fix | Delete
'gutter_width' => array(
[205] Fix | Delete
'label' => esc_html__( 'Gutter Width', 'et_builder' ),
[206] Fix | Delete
'type' => 'range',
[207] Fix | Delete
'option_category' => 'layout',
[208] Fix | Delete
'range_settings' => array(
[209] Fix | Delete
'min' => 1,
[210] Fix | Delete
'max' => 4,
[211] Fix | Delete
'step' => 1,
[212] Fix | Delete
'min_limit' => 1,
[213] Fix | Delete
'max_limit' => 4,
[214] Fix | Delete
),
[215] Fix | Delete
'depends_show_if' => 'on',
[216] Fix | Delete
'tab_slug' => 'advanced',
[217] Fix | Delete
'toggle_slug' => 'width',
[218] Fix | Delete
'specialty_only' => 'yes',
[219] Fix | Delete
'validate_unit' => false,
[220] Fix | Delete
'fixed_range' => true,
[221] Fix | Delete
'default_on_front' => (string) et_get_option( 'gutter_width', '3' ),
[222] Fix | Delete
'hover' => 'tabs',
[223] Fix | Delete
'description' => esc_html__( 'Gutter width controls the space between each column in a row. Lowering the gutter width will cause modules to become closer together.', 'et_builder' ),
[224] Fix | Delete
),
[225] Fix | Delete
'columns_background' => array(
[226] Fix | Delete
'type' => 'column_settings_background',
[227] Fix | Delete
'option_category' => 'configuration',
[228] Fix | Delete
'toggle_slug' => 'background',
[229] Fix | Delete
'specialty_only' => 'yes',
[230] Fix | Delete
'priority' => 99,
[231] Fix | Delete
),
[232] Fix | Delete
'columns_padding' => array(
[233] Fix | Delete
'type' => 'column_settings_padding',
[234] Fix | Delete
'option_category' => 'configuration',
[235] Fix | Delete
'tab_slug' => 'advanced',
[236] Fix | Delete
'toggle_slug' => 'margin_padding',
[237] Fix | Delete
'specialty_only' => 'yes',
[238] Fix | Delete
'priority' => 99,
[239] Fix | Delete
),
[240] Fix | Delete
'fullwidth' => array(
[241] Fix | Delete
'type' => 'hidden',
[242] Fix | Delete
'default_on_front' => 'off',
[243] Fix | Delete
),
[244] Fix | Delete
'specialty' => array(
[245] Fix | Delete
'type' => 'skip',
[246] Fix | Delete
'default_on_front' => 'off',
[247] Fix | Delete
'affects' => array( 'inner_width', 'inner_max_width', ),
[248] Fix | Delete
),
[249] Fix | Delete
'columns_css' => array(
[250] Fix | Delete
'type' => 'column_settings_css',
[251] Fix | Delete
'option_category' => 'configuration',
[252] Fix | Delete
'tab_slug' => 'custom_css',
[253] Fix | Delete
'toggle_slug' => 'custom_css',
[254] Fix | Delete
'priority' => 20,
[255] Fix | Delete
),
[256] Fix | Delete
'columns_css_fields' => array(
[257] Fix | Delete
'type' => 'column_settings_css_fields',
[258] Fix | Delete
'option_category' => 'configuration',
[259] Fix | Delete
'tab_slug' => 'custom_css',
[260] Fix | Delete
'toggle_slug' => 'classes',
[261] Fix | Delete
'priority' => 20,
[262] Fix | Delete
),
[263] Fix | Delete
'custom_padding_last_edited' => array(
[264] Fix | Delete
'type' => 'skip',
[265] Fix | Delete
'tab_slug' => 'advanced',
[266] Fix | Delete
'specialty_only' => 'yes',
[267] Fix | Delete
),
[268] Fix | Delete
'__video_background' => array(
[269] Fix | Delete
'type' => 'computed',
[270] Fix | Delete
'computed_callback' => array( 'ET_Builder_Module_Helper_ResponsiveOptions', 'get_video_background' ),
[271] Fix | Delete
'computed_depends_on' => array(
[272] Fix | Delete
'background_video_mp4',
[273] Fix | Delete
'background_video_webm',
[274] Fix | Delete
'background_video_width',
[275] Fix | Delete
'background_video_height',
[276] Fix | Delete
),
[277] Fix | Delete
'computed_minimum' => array(
[278] Fix | Delete
'background_video_mp4',
[279] Fix | Delete
'background_video_webm',
[280] Fix | Delete
),
[281] Fix | Delete
),
[282] Fix | Delete
'prev_background_color' => array(
[283] Fix | Delete
'type' => 'skip',
[284] Fix | Delete
),
[285] Fix | Delete
'next_background_color' => array(
[286] Fix | Delete
'type' => 'skip',
[287] Fix | Delete
),
[288] Fix | Delete
);
[289] Fix | Delete
[290] Fix | Delete
$column_fields = $this->get_column_fields( 3, array(
[291] Fix | Delete
'parallax' => array(
[292] Fix | Delete
'default_on_front' => 'off',
[293] Fix | Delete
),
[294] Fix | Delete
'parallax_method' => array(
[295] Fix | Delete
'default_on_front' => 'on',
[296] Fix | Delete
),
[297] Fix | Delete
'background_color' => array(),
[298] Fix | Delete
'bg_img' => array(),
[299] Fix | Delete
'background_size' => array(),
[300] Fix | Delete
'background_position' => array(),
[301] Fix | Delete
'background_repeat' => array(),
[302] Fix | Delete
'background_blend' => array(),
[303] Fix | Delete
'padding_top_bottom_link' => array(),
[304] Fix | Delete
'padding_left_right_link' => array(),
[305] Fix | Delete
'use_background_color_gradient' => array(),
[306] Fix | Delete
'background_color_gradient_start' => array(),
[307] Fix | Delete
'background_color_gradient_end' => array(),
[308] Fix | Delete
'background_color_gradient_type' => array(),
[309] Fix | Delete
'background_color_gradient_direction' => array(),
[310] Fix | Delete
'background_color_gradient_direction_radial' => array(),
[311] Fix | Delete
'background_color_gradient_start_position' => array(),
[312] Fix | Delete
'background_color_gradient_end_position' => array(),
[313] Fix | Delete
'background_color_gradient_overlays_image' => array(),
[314] Fix | Delete
'background_video_mp4' => array(
[315] Fix | Delete
'computed_affects' => array(
[316] Fix | Delete
'__video_background',
[317] Fix | Delete
),
[318] Fix | Delete
),
[319] Fix | Delete
'background_video_webm' => array(
[320] Fix | Delete
'computed_affects' => array(
[321] Fix | Delete
'__video_background',
[322] Fix | Delete
),
[323] Fix | Delete
),
[324] Fix | Delete
'background_video_width' => array(
[325] Fix | Delete
'computed_affects' => array(
[326] Fix | Delete
'__video_background',
[327] Fix | Delete
),
[328] Fix | Delete
),
[329] Fix | Delete
'background_video_height' => array(
[330] Fix | Delete
'computed_affects' => array(
[331] Fix | Delete
'__video_background',
[332] Fix | Delete
),
[333] Fix | Delete
),
[334] Fix | Delete
'allow_player_pause' => array(
[335] Fix | Delete
'computed_affects' => array(
[336] Fix | Delete
'__video_background',
[337] Fix | Delete
),
[338] Fix | Delete
),
[339] Fix | Delete
'background_video_pause_outside_viewport' => array(
[340] Fix | Delete
'computed_affects' => array(
[341] Fix | Delete
'__video_background',
[342] Fix | Delete
),
[343] Fix | Delete
),
[344] Fix | Delete
'__video_background' => array(
[345] Fix | Delete
'type' => 'computed',
[346] Fix | Delete
'computed_callback' => array(
[347] Fix | Delete
'ET_Builder_Column',
[348] Fix | Delete
'get_column_video_background'
[349] Fix | Delete
),
[350] Fix | Delete
'computed_depends_on' => array(
[351] Fix | Delete
'background_video_mp4',
[352] Fix | Delete
'background_video_webm',
[353] Fix | Delete
'background_video_width',
[354] Fix | Delete
'background_video_height',
[355] Fix | Delete
),
[356] Fix | Delete
'computed_minimum' => array(
[357] Fix | Delete
'background_video_mp4',
[358] Fix | Delete
'background_video_webm',
[359] Fix | Delete
),
[360] Fix | Delete
),
[361] Fix | Delete
'padding_top' => array( 'tab_slug' => 'advanced' ),
[362] Fix | Delete
'padding_right' => array( 'tab_slug' => 'advanced' ),
[363] Fix | Delete
'padding_bottom' => array( 'tab_slug' => 'advanced' ),
[364] Fix | Delete
'padding_left' => array( 'tab_slug' => 'advanced' ),
[365] Fix | Delete
'padding_top_bottom_link' => array( 'tab_slug' => 'advanced' ),
[366] Fix | Delete
'padding_left_right_link' => array( 'tab_slug' => 'advanced' ),
[367] Fix | Delete
'padding_%column_index%_tablet' => array(
[368] Fix | Delete
'has_custom_index_location' => true,
[369] Fix | Delete
'tab_slug' => 'advanced',
[370] Fix | Delete
),
[371] Fix | Delete
'padding_%column_index%_phone' => array(
[372] Fix | Delete
'has_custom_index_location' => true,
[373] Fix | Delete
'tab_slug' => 'advanced',
[374] Fix | Delete
),
[375] Fix | Delete
'padding_%column_index%_last_edited' => array(
[376] Fix | Delete
'has_custom_index_location' => true,
[377] Fix | Delete
'tab_slug' => 'advanced',
[378] Fix | Delete
),
[379] Fix | Delete
'module_id' => array( 'tab_slug' => 'custom_css' ),
[380] Fix | Delete
'module_class' => array( 'tab_slug' => 'custom_css' ),
[381] Fix | Delete
'custom_css_before' => array( 'tab_slug' => 'custom_css' ),
[382] Fix | Delete
'custom_css_main' => array( 'tab_slug' => 'custom_css' ),
[383] Fix | Delete
'custom_css_after' => array( 'tab_slug' => 'custom_css' ),
[384] Fix | Delete
) );
[385] Fix | Delete
[386] Fix | Delete
return array_merge( $fields, $column_fields );
[387] Fix | Delete
}
[388] Fix | Delete
[389] Fix | Delete
public function get_transition_fields_css_props() {
[390] Fix | Delete
$fields = parent::get_transition_fields_css_props();
[391] Fix | Delete
[392] Fix | Delete
// Section Dividers Height
[393] Fix | Delete
foreach ( array( 'top', 'bottom' ) as $placement ) {
[394] Fix | Delete
// Inside sprintf, the double %% prints a literal '%' character
[395] Fix | Delete
$selector = sprintf(
[396] Fix | Delete
'%%%%order_class%%%%.section_has_divider.et_pb_%1$s_divider .et_pb_%1$s_inside_divider',
[397] Fix | Delete
$placement
[398] Fix | Delete
);
[399] Fix | Delete
$fields[ "{$placement}_divider_height" ] = array(
[400] Fix | Delete
'height' => $selector,
[401] Fix | Delete
'background-size' => $selector,
[402] Fix | Delete
);
[403] Fix | Delete
}
[404] Fix | Delete
[405] Fix | Delete
return $fields;
[406] Fix | Delete
}
[407] Fix | Delete
[408] Fix | Delete
/**
[409] Fix | Delete
* Check if current background is transparent background or not.
[410] Fix | Delete
*
[411] Fix | Delete
* @since 3.24.1
[412] Fix | Delete
*
[413] Fix | Delete
* @return boolean Transparent color status.
[414] Fix | Delete
*/
[415] Fix | Delete
public function is_transparent_background( $background_color = '' ) {
[416] Fix | Delete
$page_setting_section_background = et_builder_settings_get( 'et_pb_section_background_color', get_the_ID() );
[417] Fix | Delete
$is_empty_background_color = '' === $background_color && '' === $page_setting_section_background;
[418] Fix | Delete
$is_layout_block = ET_GB_Block_Layout::is_layout_block() || ET_GB_Block_Layout::is_layout_block_preview();
[419] Fix | Delete
[420] Fix | Delete
return 'rgba(255,255,255,0)' === $background_color
[421] Fix | Delete
|| ( $is_layout_block && $is_empty_background_color )
[422] Fix | Delete
|| ( et_is_builder_plugin_active() && $is_empty_background_color );
[423] Fix | Delete
}
[424] Fix | Delete
[425] Fix | Delete
/**
[426] Fix | Delete
* Check if current background should have initial background color.
[427] Fix | Delete
*
[428] Fix | Delete
* @since 3.24.1
[429] Fix | Delete
*
[430] Fix | Delete
* @param string $mode
[431] Fix | Delete
*
[432] Fix | Delete
* @return boolean
[433] Fix | Delete
*/
[434] Fix | Delete
public function is_initial_background_color( $mode = 'desktop' ) {
[435] Fix | Delete
// Ensure $mode parameter not empty.
[436] Fix | Delete
$mode = '' === $mode ? 'desktop' : $mode;
[437] Fix | Delete
$device_suffix = 'desktop' !== $mode && 'hover' !== $mode ? "_{$mode}" : '';
[438] Fix | Delete
[439] Fix | Delete
$parallax = 'hover' === $mode ? et_pb_hover_options()->get_raw_value( 'parallax', $this->props ) : et_pb_responsive_options()->get_any_value( $this->props, "parallax{$device_suffix}", '', true );
[440] Fix | Delete
$background_blend = 'hover' === $mode ? et_pb_hover_options()->get_raw_value( 'background_blend', $this->props ) : et_pb_responsive_options()->get_any_value( $this->props, "background_blend{$device_suffix}", '', true );
[441] Fix | Delete
$use_gradient_value = et_pb_responsive_options()->get_inheritance_background_value( $this->props, 'use_background_color_gradient', $mode );
[442] Fix | Delete
$background_image = et_pb_responsive_options()->get_inheritance_background_value( $this->props, 'background_image', $mode );
[443] Fix | Delete
$bg_blend_default = self::$_->array_get( $this->fields_unprocessed, 'background_blend.default', '' );
[444] Fix | Delete
[445] Fix | Delete
$is_gradient_active = 'on' === $use_gradient_value;
[446] Fix | Delete
$is_image_active = '' !== $background_image && 'on' !== $parallax;
[447] Fix | Delete
$is_image_blend = '' !== $background_blend && $background_blend !== $bg_blend_default;
[448] Fix | Delete
[449] Fix | Delete
return $is_gradient_active && $is_image_active && $is_image_blend;
[450] Fix | Delete
}
[451] Fix | Delete
[452] Fix | Delete
/**
[453] Fix | Delete
* Get parallax image background.
[454] Fix | Delete
*
[455] Fix | Delete
* @since 3.24.1
[456] Fix | Delete
*
[457] Fix | Delete
* @return HTML Parallax backgrounds markup.
[458] Fix | Delete
*/
[459] Fix | Delete
public function get_parallax_image_background( $base_name = 'background' ) {
[460] Fix | Delete
$attr_prefix = "{$base_name}_";
[461] Fix | Delete
[462] Fix | Delete
$parallax_processed = array();
[463] Fix | Delete
$parallax_background = '';
[464] Fix | Delete
$hover_suffix = et_pb_hover_options()->get_suffix();
[465] Fix | Delete
$preview_modes = array( $hover_suffix, '_phone', '_tablet', '' );
[466] Fix | Delete
[467] Fix | Delete
// Featured Image as Background.
[468] Fix | Delete
$featured_image = '';
[469] Fix | Delete
$featured_placement = '';
[470] Fix | Delete
$featured_image_src = '';
[471] Fix | Delete
if ( $this->featured_image_background ) {
[472] Fix | Delete
$featured_image = self::$_->array_get( $this->props, 'featured_image', '' );
[473] Fix | Delete
$featured_placement = self::$_->array_get( $this->props, 'featured_placement', '' );
[474] Fix | Delete
$featured_image_src_obj = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' );
[475] Fix | Delete
$featured_image_src = isset( $featured_image_src_obj[0] ) ? $featured_image_src_obj[0] : '';
[476] Fix | Delete
}
[477] Fix | Delete
[478] Fix | Delete
foreach( $preview_modes as $suffix ) {
[479] Fix | Delete
$is_hover = $hover_suffix === $suffix;
[480] Fix | Delete
[481] Fix | Delete
// A. Bail early if hover or responsive settings disabled on mobile/hover.
[482] Fix | Delete
if ( '' !== $suffix ) {
[483] Fix | Delete
// Ensure responsive settings is enabled on mobile.
[484] Fix | Delete
if ( ! $is_hover && ! et_pb_responsive_options()->is_responsive_enabled( $this->props, $base_name ) ) {
[485] Fix | Delete
continue;
[486] Fix | Delete
}
[487] Fix | Delete
[488] Fix | Delete
// Ensure hover settings is enabled.
[489] Fix | Delete
if ( $is_hover && ! et_pb_hover_options()->is_enabled( $base_name, $this->props ) ) {
[490] Fix | Delete
continue;
[491] Fix | Delete
}
[492] Fix | Delete
}
[493] Fix | Delete
[494] Fix | Delete
// Prepare preview mode.
[495] Fix | Delete
$mode = '' !== $suffix ? str_replace( '_', '', $suffix ) : 'desktop';
[496] Fix | Delete
$mode = $is_hover ? 'hover' : $mode;
[497] Fix | Delete
[498] Fix | Delete
// B.1. Get inherited background value.
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function