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/module
File: Toggle.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class ET_Builder_Module_Toggle extends ET_Builder_Module {
[2] Fix | Delete
function init() {
[3] Fix | Delete
$this->name = esc_html__( 'Toggle', 'et_builder' );
[4] Fix | Delete
$this->plural = esc_html__( 'Toggles', 'et_builder' );
[5] Fix | Delete
$this->slug = 'et_pb_toggle';
[6] Fix | Delete
$this->vb_support = 'on';
[7] Fix | Delete
$this->additional_shortcode_slugs = array( 'et_pb_accordion_item' );
[8] Fix | Delete
$this->main_css_element = '%%order_class%%.et_pb_toggle';
[9] Fix | Delete
[10] Fix | Delete
$this->settings_modal_toggles = array(
[11] Fix | Delete
'general' => array(
[12] Fix | Delete
'toggles' => array(
[13] Fix | Delete
'main_content' => et_builder_i18n( 'Text' ),
[14] Fix | Delete
'state' => esc_html__( 'State', 'et_builder' ),
[15] Fix | Delete
),
[16] Fix | Delete
),
[17] Fix | Delete
'advanced' => array(
[18] Fix | Delete
'toggles' => array(
[19] Fix | Delete
'icon' => esc_html__( 'Icon', 'et_builder' ),
[20] Fix | Delete
'text' => array(
[21] Fix | Delete
'title' => et_builder_i18n( 'Text' ),
[22] Fix | Delete
'priority' => 49,
[23] Fix | Delete
),
[24] Fix | Delete
'toggle' => esc_html__( 'Toggle', 'et_builder' ),
[25] Fix | Delete
),
[26] Fix | Delete
),
[27] Fix | Delete
);
[28] Fix | Delete
[29] Fix | Delete
$this->advanced_fields = array(
[30] Fix | Delete
'borders' => array(
[31] Fix | Delete
'default' => array(
[32] Fix | Delete
'css' => array(
[33] Fix | Delete
'main' => array(
[34] Fix | Delete
'border_radii' => ".et_pb_module{$this->main_css_element}",
[35] Fix | Delete
'border_styles' => ".et_pb_module{$this->main_css_element}",
[36] Fix | Delete
)
[37] Fix | Delete
),
[38] Fix | Delete
'defaults' => array(
[39] Fix | Delete
'border_radii' => 'on||||',
[40] Fix | Delete
'border_styles' => array(
[41] Fix | Delete
'width' => '1px',
[42] Fix | Delete
'color' => '#d9d9d9',
[43] Fix | Delete
'style' => 'solid',
[44] Fix | Delete
),
[45] Fix | Delete
)
[46] Fix | Delete
),
[47] Fix | Delete
),
[48] Fix | Delete
'box_shadow' => array(
[49] Fix | Delete
'default' => array(
[50] Fix | Delete
'css' => array(
[51] Fix | Delete
'important' => true,
[52] Fix | Delete
),
[53] Fix | Delete
),
[54] Fix | Delete
),
[55] Fix | Delete
'fonts' => array(
[56] Fix | Delete
'title' => array(
[57] Fix | Delete
'label' => et_builder_i18n( 'Title' ),
[58] Fix | Delete
'css' => array(
[59] Fix | Delete
'main' => "{$this->main_css_element} h5, {$this->main_css_element} h1.et_pb_toggle_title, {$this->main_css_element} h2.et_pb_toggle_title, {$this->main_css_element} h3.et_pb_toggle_title, {$this->main_css_element} h4.et_pb_toggle_title, {$this->main_css_element} h6.et_pb_toggle_title",
[60] Fix | Delete
'important' => 'plugin_only',
[61] Fix | Delete
),
[62] Fix | Delete
'header_level' => array(
[63] Fix | Delete
'default' => 'h5',
[64] Fix | Delete
),
[65] Fix | Delete
'options_priority' => array(
[66] Fix | Delete
'title_text_color' => 9,
[67] Fix | Delete
),
[68] Fix | Delete
),
[69] Fix | Delete
'closed_title' => array(
[70] Fix | Delete
'label' => esc_html__( 'Closed Title', 'et_builder' ),
[71] Fix | Delete
'css' => array(
[72] Fix | Delete
'main' => "{$this->main_css_element}.et_pb_toggle_close h5, {$this->main_css_element}.et_pb_toggle_close h1.et_pb_toggle_title, {$this->main_css_element}.et_pb_toggle_close h2.et_pb_toggle_title, {$this->main_css_element}.et_pb_toggle_close h3.et_pb_toggle_title, {$this->main_css_element}.et_pb_toggle_close h4.et_pb_toggle_title, {$this->main_css_element}.et_pb_toggle_close h6.et_pb_toggle_title",
[73] Fix | Delete
'important' => 'plugin_only',
[74] Fix | Delete
),
[75] Fix | Delete
'hide_text_color' => true,
[76] Fix | Delete
'line_height' => array(
[77] Fix | Delete
'default' => '1.7em',
[78] Fix | Delete
),
[79] Fix | Delete
'font_size' => array(
[80] Fix | Delete
'default' => '16px',
[81] Fix | Delete
),
[82] Fix | Delete
'letter_spacing' => array(
[83] Fix | Delete
'default' => '0px',
[84] Fix | Delete
),
[85] Fix | Delete
),
[86] Fix | Delete
'closed_title' => array(
[87] Fix | Delete
'label' => esc_html__( 'Closed Title', 'et_builder' ),
[88] Fix | Delete
'css' => array(
[89] Fix | Delete
'main' => "{$this->main_css_element}.et_pb_toggle_close h5, {$this->main_css_element}.et_pb_toggle_close h1.et_pb_toggle_title, {$this->main_css_element}.et_pb_toggle_close h2.et_pb_toggle_title, {$this->main_css_element}.et_pb_toggle_close h3.et_pb_toggle_title, {$this->main_css_element}.et_pb_toggle_close h4.et_pb_toggle_title, {$this->main_css_element}.et_pb_toggle_close h6.et_pb_toggle_title",
[90] Fix | Delete
'important' => 'plugin_only',
[91] Fix | Delete
),
[92] Fix | Delete
'hide_text_color' => true,
[93] Fix | Delete
'default_from' => 'title',
[94] Fix | Delete
'line_height' => array(
[95] Fix | Delete
'default' => '1.7em',
[96] Fix | Delete
),
[97] Fix | Delete
'font_size' => array(
[98] Fix | Delete
'default' => '16px',
[99] Fix | Delete
),
[100] Fix | Delete
'letter_spacing' => array(
[101] Fix | Delete
'default' => '0px',
[102] Fix | Delete
),
[103] Fix | Delete
),
[104] Fix | Delete
'body' => array(
[105] Fix | Delete
'label' => et_builder_i18n( 'Body' ),
[106] Fix | Delete
'css' => array(
[107] Fix | Delete
'main' => "{$this->main_css_element}",
[108] Fix | Delete
'limited_main' => "{$this->main_css_element}, {$this->main_css_element} p, {$this->main_css_element} .et_pb_toggle_content",
[109] Fix | Delete
'line_height' => "{$this->main_css_element} p",
[110] Fix | Delete
'text_shadow' => "{$this->main_css_element} .et_pb_toggle_content",
[111] Fix | Delete
),
[112] Fix | Delete
'block_elements' => array(
[113] Fix | Delete
'tabbed_subtoggles' => true,
[114] Fix | Delete
'bb_icons_support' => true,
[115] Fix | Delete
),
[116] Fix | Delete
),
[117] Fix | Delete
),
[118] Fix | Delete
'background' => array(
[119] Fix | Delete
'settings' => array(
[120] Fix | Delete
'color' => 'alpha',
[121] Fix | Delete
),
[122] Fix | Delete
),
[123] Fix | Delete
'margin_padding' => array(
[124] Fix | Delete
'css' => array(
[125] Fix | Delete
'important' => 'all',
[126] Fix | Delete
),
[127] Fix | Delete
),
[128] Fix | Delete
'button' => false,
[129] Fix | Delete
'position_fields' => array(
[130] Fix | Delete
'default' => 'relative',
[131] Fix | Delete
),
[132] Fix | Delete
'z_index' => array(
[133] Fix | Delete
'default' => '1',
[134] Fix | Delete
),
[135] Fix | Delete
);
[136] Fix | Delete
[137] Fix | Delete
$this->custom_css_fields = array(
[138] Fix | Delete
'open_toggle' => array(
[139] Fix | Delete
'label' => esc_html__( 'Open Toggle', 'et_builder' ),
[140] Fix | Delete
'selector' => '.et_pb_toggle.et_pb_toggle_open',
[141] Fix | Delete
'no_space_before_selector' => true,
[142] Fix | Delete
),
[143] Fix | Delete
'toggle_title' => array(
[144] Fix | Delete
'label' => esc_html__( 'Toggle Title', 'et_builder' ),
[145] Fix | Delete
'selector' => '.et_pb_toggle_title',
[146] Fix | Delete
),
[147] Fix | Delete
'toggle_icon' => array(
[148] Fix | Delete
'label' => esc_html__( 'Toggle Icon', 'et_builder' ),
[149] Fix | Delete
'selector' => '.et_pb_toggle_title:before',
[150] Fix | Delete
),
[151] Fix | Delete
'toggle_content' => array(
[152] Fix | Delete
'label' => esc_html__( 'Toggle Content', 'et_builder' ),
[153] Fix | Delete
'selector' => '.et_pb_toggle_content',
[154] Fix | Delete
),
[155] Fix | Delete
);
[156] Fix | Delete
[157] Fix | Delete
$this->help_videos = array(
[158] Fix | Delete
array(
[159] Fix | Delete
'id' => 'hFgp_A_u7mg',
[160] Fix | Delete
'name' => esc_html__( 'An introduction to the Toggle module', 'et_builder' ),
[161] Fix | Delete
),
[162] Fix | Delete
);
[163] Fix | Delete
}
[164] Fix | Delete
[165] Fix | Delete
function get_fields() {
[166] Fix | Delete
$fields = array(
[167] Fix | Delete
'title' => array(
[168] Fix | Delete
'label' => et_builder_i18n( 'Title' ),
[169] Fix | Delete
'type' => 'text',
[170] Fix | Delete
'option_category' => 'basic_option',
[171] Fix | Delete
'description' => esc_html__( 'The title will appear above the content and when the toggle is closed.', 'et_builder' ),
[172] Fix | Delete
'toggle_slug' => 'main_content',
[173] Fix | Delete
'dynamic_content' => 'text',
[174] Fix | Delete
'mobile_options' => true,
[175] Fix | Delete
'hover' => 'tabs',
[176] Fix | Delete
),
[177] Fix | Delete
'open' => array(
[178] Fix | Delete
'label' => esc_html__( 'State', 'et_builder' ),
[179] Fix | Delete
'type' => 'select',
[180] Fix | Delete
'option_category' => 'basic_option',
[181] Fix | Delete
'options' => array(
[182] Fix | Delete
'off' => esc_html__( 'Close', 'et_builder' ),
[183] Fix | Delete
'on' => esc_html__( 'Open', 'et_builder' ),
[184] Fix | Delete
),
[185] Fix | Delete
'default_on_front' => 'off',
[186] Fix | Delete
'toggle_slug' => 'state',
[187] Fix | Delete
'description' => esc_html__( 'Choose whether or not this toggle should start in an open or closed state.', 'et_builder' ),
[188] Fix | Delete
),
[189] Fix | Delete
'content' => array(
[190] Fix | Delete
'label' => et_builder_i18n( 'Body' ),
[191] Fix | Delete
'type' => 'tiny_mce',
[192] Fix | Delete
'option_category' => 'basic_option',
[193] Fix | Delete
'description' => esc_html__( 'Input the main text content for your module here.', 'et_builder' ),
[194] Fix | Delete
'toggle_slug' => 'main_content',
[195] Fix | Delete
'dynamic_content' => 'text',
[196] Fix | Delete
'mobile_options' => true,
[197] Fix | Delete
'hover' => 'tabs',
[198] Fix | Delete
),
[199] Fix | Delete
'open_toggle_text_color' => array(
[200] Fix | Delete
'label' => esc_html__( 'Open Title Text Color', 'et_builder' ),
[201] Fix | Delete
'description' => esc_html__( 'You can pick unique text colors for toggle titles when they are open and closed. Choose the open state title color here.', 'et_builder' ),
[202] Fix | Delete
'type' => 'color-alpha',
[203] Fix | Delete
'custom_color' => true,
[204] Fix | Delete
'tab_slug' => 'advanced',
[205] Fix | Delete
'toggle_slug' => 'title',
[206] Fix | Delete
'hover' => 'tabs',
[207] Fix | Delete
'mobile_options' => true,
[208] Fix | Delete
),
[209] Fix | Delete
'open_toggle_background_color' => array(
[210] Fix | Delete
'label' => esc_html__( 'Open Toggle Background Color', 'et_builder' ),
[211] Fix | Delete
'description' => esc_html__( 'You can pick unique background colors for toggles when they are in their open and closed states. Choose the open state background color here.', 'et_builder' ),
[212] Fix | Delete
'type' => 'color-alpha',
[213] Fix | Delete
'custom_color' => true,
[214] Fix | Delete
'tab_slug' => 'advanced',
[215] Fix | Delete
'toggle_slug' => 'toggle',
[216] Fix | Delete
'hover' => 'tabs',
[217] Fix | Delete
'mobile_options' => true,
[218] Fix | Delete
),
[219] Fix | Delete
'closed_toggle_text_color' => array(
[220] Fix | Delete
'label' => esc_html__( 'Closed Title Text Color', 'et_builder' ),
[221] Fix | Delete
'description' => esc_html__( 'You can pick unique text colors for toggle titles when they are open and closed. Choose the closed state title color here.', 'et_builder' ),
[222] Fix | Delete
'type' => 'color-alpha',
[223] Fix | Delete
'custom_color' => true,
[224] Fix | Delete
'tab_slug' => 'advanced',
[225] Fix | Delete
'toggle_slug' => 'closed_title',
[226] Fix | Delete
'hover' => 'tabs',
[227] Fix | Delete
'mobile_options' => true,
[228] Fix | Delete
),
[229] Fix | Delete
'closed_toggle_background_color' => array(
[230] Fix | Delete
'label' => esc_html__( 'Closed Toggle Background Color', 'et_builder' ),
[231] Fix | Delete
'description' => esc_html__( 'You can pick unique background colors for toggles when they are in their open and closed states. Choose the closed state background color here.', 'et_builder' ),
[232] Fix | Delete
'type' => 'color-alpha',
[233] Fix | Delete
'custom_color' => true,
[234] Fix | Delete
'tab_slug' => 'advanced',
[235] Fix | Delete
'toggle_slug' => 'toggle',
[236] Fix | Delete
'hover' => 'tabs',
[237] Fix | Delete
'mobile_options' => true,
[238] Fix | Delete
),
[239] Fix | Delete
'icon_color' => array(
[240] Fix | Delete
'label' => esc_html__( 'Icon Color', 'et_builder' ),
[241] Fix | Delete
'description' => esc_html__( 'Here you can define a custom color for the toggle icon.', 'et_builder' ),
[242] Fix | Delete
'type' => 'color-alpha',
[243] Fix | Delete
'custom_color' => true,
[244] Fix | Delete
'tab_slug' => 'advanced',
[245] Fix | Delete
'toggle_slug' => 'icon',
[246] Fix | Delete
'hover' => 'tabs',
[247] Fix | Delete
'mobile_options' => true,
[248] Fix | Delete
),
[249] Fix | Delete
'use_icon_font_size' => array(
[250] Fix | Delete
'label' => esc_html__( 'Use Custom Icon Size', 'et_builder' ),
[251] Fix | Delete
'description' => esc_html__( 'If you would like to control the size of the icon, you must first enable this option.', 'et_builder' ),
[252] Fix | Delete
'type' => 'yes_no_button',
[253] Fix | Delete
'options' => array(
[254] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[255] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[256] Fix | Delete
),
[257] Fix | Delete
'default_on_front' => 'off',
[258] Fix | Delete
'affects' => array(
[259] Fix | Delete
'icon_font_size',
[260] Fix | Delete
),
[261] Fix | Delete
'depends_show_if' => 'on',
[262] Fix | Delete
'tab_slug' => 'advanced',
[263] Fix | Delete
'toggle_slug' => 'icon',
[264] Fix | Delete
'option_category' => 'font_option',
[265] Fix | Delete
),
[266] Fix | Delete
'icon_font_size' => array(
[267] Fix | Delete
'label' => esc_html__( 'Icon Font Size', 'et_builder' ),
[268] Fix | Delete
'description' => esc_html__( 'Control the size of the icon by increasing or decreasing the font size.', 'et_builder' ),
[269] Fix | Delete
'type' => 'range',
[270] Fix | Delete
'option_category' => 'font_option',
[271] Fix | Delete
'tab_slug' => 'advanced',
[272] Fix | Delete
'toggle_slug' => 'icon',
[273] Fix | Delete
'default' => '16px',
[274] Fix | Delete
'default_unit' => 'px',
[275] Fix | Delete
'default_on_front' => '',
[276] Fix | Delete
'range_settings' => array(
[277] Fix | Delete
'min' => '1',
[278] Fix | Delete
'max' => '120',
[279] Fix | Delete
'step' => '1',
[280] Fix | Delete
),
[281] Fix | Delete
'mobile_options' => true,
[282] Fix | Delete
'depends_show_if' => 'on',
[283] Fix | Delete
'responsive' => true,
[284] Fix | Delete
'hover' => 'tabs',
[285] Fix | Delete
),
[286] Fix | Delete
);
[287] Fix | Delete
return $fields;
[288] Fix | Delete
}
[289] Fix | Delete
[290] Fix | Delete
public function get_transition_fields_css_props() {
[291] Fix | Delete
$fields = parent::get_transition_fields_css_props();
[292] Fix | Delete
$title = '%%order_class%% .et_pb_toggle .et_pb_toggle_title';
[293] Fix | Delete
[294] Fix | Delete
$fields['icon_color'] = array( 'color' => '%%order_class%% .et_pb_toggle_title:before' );
[295] Fix | Delete
$fields['icon_font_size'] = array(
[296] Fix | Delete
'font-size' => '%%order_class%% .et_pb_toggle_title:before',
[297] Fix | Delete
'margin-top' => '%%order_class%% .et_pb_toggle_title:before',
[298] Fix | Delete
'right' => '%%order_class%% .et_pb_toggle_title:before',
[299] Fix | Delete
);
[300] Fix | Delete
[301] Fix | Delete
$fields['toggle_text_color'] = array( 'color' => $title );
[302] Fix | Delete
$fields['toggle_font_size'] = array( 'font-size' => $title );
[303] Fix | Delete
$fields['toggle_letter_spacing'] = array( 'letter-spacing' => $title );
[304] Fix | Delete
$fields['toggle_line_height'] = array( 'line-height' => $title );
[305] Fix | Delete
$fields['toggle_text_shadow_style'] = array( 'text-shadow' => $title );
[306] Fix | Delete
[307] Fix | Delete
$fields['closed_toggle_text_color'] = array( 'color' => '%%order_class%%.et_pb_toggle_close .et_pb_toggle_title' );
[308] Fix | Delete
$fields['closed_toggle_background_color'] = array( 'background-color' => '%%order_class%%.et_pb_toggle_close' );
[309] Fix | Delete
[310] Fix | Delete
$fields['open_toggle_text_color'] = array( 'color' => '%%order_class%%.et_pb_toggle_open .et_pb_toggle_title' );
[311] Fix | Delete
$fields['open_toggle_background_color'] = array( 'background-color' => '%%order_class%%.et_pb_toggle_open' );
[312] Fix | Delete
[313] Fix | Delete
return $fields;
[314] Fix | Delete
}
[315] Fix | Delete
[316] Fix | Delete
function render( $attrs, $content = null, $render_slug ) {
[317] Fix | Delete
$multi_view = et_pb_multi_view_options( $this );
[318] Fix | Delete
$open = $this->props['open'];
[319] Fix | Delete
$header_level = $this->props['title_level'];
[320] Fix | Delete
$open_toggle_background_color_values = et_pb_responsive_options()->get_property_values( $this->props, 'open_toggle_background_color' );
[321] Fix | Delete
$open_toggle_background_color_hover = $this->get_hover_value( 'open_toggle_background_color' );
[322] Fix | Delete
$closed_toggle_background_color_values = et_pb_responsive_options()->get_property_values( $this->props, 'closed_toggle_background_color' );
[323] Fix | Delete
$closed_toggle_background_color_hover = $this->get_hover_value( 'closed_toggle_background_color' );
[324] Fix | Delete
$icon_color_values = et_pb_responsive_options()->get_property_values( $this->props, 'icon_color' );
[325] Fix | Delete
$icon_color_hover = $this->get_hover_value( 'icon_color' );
[326] Fix | Delete
$use_icon_font_size = $this->props['use_icon_font_size'];
[327] Fix | Delete
$icon_font_size_values = et_pb_responsive_options()->get_property_values( $this->props, 'icon_font_size' );
[328] Fix | Delete
$icon_font_size_any_values = et_pb_responsive_options()->get_property_values( $this->props, 'icon_font_size', '16px', true ); // 16px is default toggle icon size.
[329] Fix | Delete
$icon_font_size_hover = $this->get_hover_value( 'icon_font_size' );
[330] Fix | Delete
$closed_toggle_text_color_values = et_pb_responsive_options()->get_property_values( $this->props, 'closed_toggle_text_color' );
[331] Fix | Delete
$closed_toggle_text_color_hover = $this->get_hover_value( 'closed_toggle_text_color' );
[332] Fix | Delete
$open_toggle_text_color_values = et_pb_responsive_options()->get_property_values( $this->props, 'open_toggle_text_color' );
[333] Fix | Delete
$open_toggle_text_color_hover = $this->get_hover_value( 'open_toggle_text_color' );
[334] Fix | Delete
[335] Fix | Delete
// Open Toggle Background Color.
[336] Fix | Delete
et_pb_responsive_options()->generate_responsive_css( $open_toggle_background_color_values, '%%order_class%%.et_pb_toggle.et_pb_toggle_open', 'background-color', $render_slug, '', 'color' );
[337] Fix | Delete
[338] Fix | Delete
if ( et_builder_is_hover_enabled( 'open_toggle_background_color', $this->props ) ) {
[339] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[340] Fix | Delete
'selector' => '%%order_class%%.et_pb_toggle.et_pb_toggle_open:hover',
[341] Fix | Delete
'declaration' => sprintf(
[342] Fix | Delete
'background-color: %1$s;',
[343] Fix | Delete
esc_html( $open_toggle_background_color_hover )
[344] Fix | Delete
),
[345] Fix | Delete
) );
[346] Fix | Delete
}
[347] Fix | Delete
[348] Fix | Delete
// Closed Toggle Background Color.
[349] Fix | Delete
et_pb_responsive_options()->generate_responsive_css( $closed_toggle_background_color_values, '%%order_class%%.et_pb_toggle.et_pb_toggle_close', 'background-color', $render_slug, '', 'color' );
[350] Fix | Delete
[351] Fix | Delete
if ( et_builder_is_hover_enabled( 'closed_toggle_background_color', $this->props ) ) {
[352] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[353] Fix | Delete
'selector' => '%%order_class%%.et_pb_toggle.et_pb_toggle_close:hover',
[354] Fix | Delete
'declaration' => sprintf(
[355] Fix | Delete
'background-color: %1$s;',
[356] Fix | Delete
esc_html( $closed_toggle_background_color_hover )
[357] Fix | Delete
),
[358] Fix | Delete
) );
[359] Fix | Delete
}
[360] Fix | Delete
[361] Fix | Delete
// Open Toggle Text Color.
[362] Fix | Delete
et_pb_responsive_options()->generate_responsive_css( $open_toggle_text_color_values, '%%order_class%%.et_pb_toggle.et_pb_toggle_open h5.et_pb_toggle_title, %%order_class%%.et_pb_toggle.et_pb_toggle_open h1.et_pb_toggle_title, %%order_class%%.et_pb_toggle.et_pb_toggle_open h2.et_pb_toggle_title, %%order_class%%.et_pb_toggle.et_pb_toggle_open h3.et_pb_toggle_title, %%order_class%%.et_pb_toggle.et_pb_toggle_open h4.et_pb_toggle_title, %%order_class%%.et_pb_toggle.et_pb_toggle_open h6.et_pb_toggle_title', 'color', $render_slug, ' !important;', 'color' );
[363] Fix | Delete
[364] Fix | Delete
if ( et_builder_is_hover_enabled( 'open_toggle_text_color', $this->props ) ) {
[365] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[366] Fix | Delete
'selector' => '%%order_class%%.et_pb_toggle.et_pb_toggle_open h5.et_pb_toggle_title:hover, %%order_class%%.et_pb_toggle.et_pb_toggle_open h1.et_pb_toggle_title:hover, %%order_class%%.et_pb_toggle.et_pb_toggle_open:hover h2.et_pb_toggle_title, %%order_class%%.et_pb_toggle.et_pb_toggle_open:hover h3.et_pb_toggle_title, %%order_class%%.et_pb_toggle.et_pb_toggle_open h4.et_pb_toggle_title:hover, %%order_class%%.et_pb_toggle.et_pb_toggle_open:hover h6.et_pb_toggle_title',
[367] Fix | Delete
'declaration' => sprintf(
[368] Fix | Delete
'color: %1$s !important;',
[369] Fix | Delete
esc_html( $open_toggle_text_color_hover )
[370] Fix | Delete
),
[371] Fix | Delete
) );
[372] Fix | Delete
}
[373] Fix | Delete
[374] Fix | Delete
// Closed Toggle Text Color.
[375] Fix | Delete
et_pb_responsive_options()->generate_responsive_css( $closed_toggle_text_color_values, '%%order_class%%.et_pb_toggle.et_pb_toggle_close h5.et_pb_toggle_title, %%order_class%%.et_pb_toggle.et_pb_toggle_close h1.et_pb_toggle_title, %%order_class%%.et_pb_toggle.et_pb_toggle_close h2.et_pb_toggle_title, %%order_class%%.et_pb_toggle.et_pb_toggle_close h3.et_pb_toggle_title, %%order_class%%.et_pb_toggle.et_pb_toggle_close h4.et_pb_toggle_title, %%order_class%%.et_pb_toggle.et_pb_toggle_close h6.et_pb_toggle_title', 'color', $render_slug, ' !important;', 'color' );
[376] Fix | Delete
[377] Fix | Delete
if ( et_builder_is_hover_enabled( 'closed_toggle_text_color', $this->props ) ) {
[378] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[379] Fix | Delete
'selector' => '%%order_class%%.et_pb_toggle.et_pb_toggle_close h5.et_pb_toggle_title:hover, %%order_class%%.et_pb_toggle.et_pb_toggle_close h1.et_pb_toggle_title:hover, %%order_class%%.et_pb_toggle.et_pb_toggle_close:hover h2.et_pb_toggle_title, %%order_class%%.et_pb_toggle.et_pb_toggle_close:hover h3.et_pb_toggle_title, %%order_class%%.et_pb_toggle.et_pb_toggle_close:hover h4.et_pb_toggle_title, %%order_class%%.et_pb_toggle.et_pb_toggle_close:hover h6.et_pb_toggle_title',
[380] Fix | Delete
'declaration' => sprintf(
[381] Fix | Delete
'color: %1$s !important;',
[382] Fix | Delete
esc_html( $closed_toggle_text_color_hover )
[383] Fix | Delete
),
[384] Fix | Delete
) );
[385] Fix | Delete
}
[386] Fix | Delete
[387] Fix | Delete
// Icon Size.
[388] Fix | Delete
if ( 'off' !== $use_icon_font_size ) {
[389] Fix | Delete
et_pb_responsive_options()->generate_responsive_css( $icon_font_size_values, '%%order_class%% .et_pb_toggle_title:before', 'font-size', $render_slug );
[390] Fix | Delete
[391] Fix | Delete
// Calculate right position.
[392] Fix | Delete
$is_icon_font_size_responsive = et_pb_responsive_options()->is_responsive_enabled( $this->props, 'icon_font_size' );
[393] Fix | Delete
$icon_font_size_default = '16px'; // Default toggle icon size.
[394] Fix | Delete
$icon_font_size_right_values = array();
[395] Fix | Delete
[396] Fix | Delete
foreach ( $icon_font_size_values as $device => $value ) {
[397] Fix | Delete
$icon_font_size_active = isset( $icon_font_size_any_values[ $device ] ) ? $icon_font_size_any_values[ $device ] : 0;
[398] Fix | Delete
if ( ! empty( $icon_font_size_active ) ) {
[399] Fix | Delete
$icon_font_size_active_int = (int) $icon_font_size_active;
[400] Fix | Delete
$icon_font_size_active_unit = str_replace( $icon_font_size_active_int, '', $icon_font_size_active );
[401] Fix | Delete
$icon_font_size_active_diff = (int) $icon_font_size_default - $icon_font_size_active_int;
[402] Fix | Delete
[403] Fix | Delete
// 2 is representation of left & right sides. 0 is default toggle icon right position.
[404] Fix | Delete
$icon_font_size_right_values[ $device ] = 0 !== $icon_font_size_active_diff ? round( $icon_font_size_active_diff / 2 ) . $icon_font_size_active_unit : 0;
[405] Fix | Delete
}
[406] Fix | Delete
}
[407] Fix | Delete
[408] Fix | Delete
et_pb_responsive_options()->generate_responsive_css( $icon_font_size_right_values, '%%order_class%% .et_pb_toggle_title:before', 'right', $render_slug );
[409] Fix | Delete
[410] Fix | Delete
// Hover.
[411] Fix | Delete
if ( et_builder_is_hover_enabled( 'icon_font_size', $this->props ) && '' !== $icon_font_size_hover ) {
[412] Fix | Delete
$icon_font_size_hover_int = (int) $icon_font_size_hover;
[413] Fix | Delete
$icon_font_size_hover_unit = str_replace( $icon_font_size_hover_int, '', $icon_font_size_hover );
[414] Fix | Delete
$icon_font_size_hover_diff = (int) $icon_font_size_default - $icon_font_size_hover_int;
[415] Fix | Delete
[416] Fix | Delete
// 2 is representation of left & right sides. 0 is default toggle icon right position.
[417] Fix | Delete
$icon_font_size_right_hover = 0 !== $icon_font_size_hover_diff ? round( $icon_font_size_hover_diff / 2 ) . $icon_font_size_hover_unit : 0;
[418] Fix | Delete
[419] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[420] Fix | Delete
'selector' => '%%order_class%%:hover .et_pb_toggle_title:before',
[421] Fix | Delete
'declaration' => sprintf(
[422] Fix | Delete
'right:%1$s;',
[423] Fix | Delete
esc_html( $icon_font_size_right_hover )
[424] Fix | Delete
),
[425] Fix | Delete
) );
[426] Fix | Delete
[427] Fix | Delete
// Hover Icon Size.
[428] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[429] Fix | Delete
'selector' => '%%order_class%%:hover .et_pb_toggle_title:before',
[430] Fix | Delete
'declaration' => sprintf(
[431] Fix | Delete
'font-size:%1$s;',
[432] Fix | Delete
esc_html( $icon_font_size_hover )
[433] Fix | Delete
),
[434] Fix | Delete
) );
[435] Fix | Delete
}
[436] Fix | Delete
}
[437] Fix | Delete
[438] Fix | Delete
// Icon Color.
[439] Fix | Delete
et_pb_responsive_options()->generate_responsive_css( $icon_color_values, '%%order_class%% .et_pb_toggle_title:before', 'color', $render_slug, '', 'color', ET_Builder_Element::DEFAULT_PRIORITY + 1 );
[440] Fix | Delete
[441] Fix | Delete
if ( et_builder_is_hover_enabled( 'icon_color', $this->props ) ) {
[442] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[443] Fix | Delete
'selector' => '%%order_class%%:hover .et_pb_toggle_title:before',
[444] Fix | Delete
'priority' => ET_Builder_Element::DEFAULT_PRIORITY + 1,
[445] Fix | Delete
'declaration' => sprintf(
[446] Fix | Delete
'color: %1$s;',
[447] Fix | Delete
esc_html( $icon_color_hover )
[448] Fix | Delete
),
[449] Fix | Delete
) );
[450] Fix | Delete
}
[451] Fix | Delete
[452] Fix | Delete
if ( 'et_pb_accordion_item' === $render_slug ) {
[453] Fix | Delete
global $et_pb_accordion_item_number, $et_pb_accordion_header_level;
[454] Fix | Delete
[455] Fix | Delete
$open = 1 === $et_pb_accordion_item_number ? 'on' : 'off';
[456] Fix | Delete
[457] Fix | Delete
$et_pb_accordion_item_number++;
[458] Fix | Delete
[459] Fix | Delete
$header_level = $et_pb_accordion_header_level;
[460] Fix | Delete
[461] Fix | Delete
$this->add_classname( 'et_pb_accordion_item' );
[462] Fix | Delete
}
[463] Fix | Delete
[464] Fix | Delete
// Adding "_item" class for toggle module for customizer targetting. There's no proper selector
[465] Fix | Delete
// for toggle module styles since both accordion and toggle module use the same selector
[466] Fix | Delete
if( 'et_pb_toggle' === $render_slug ){
[467] Fix | Delete
$this->add_classname( 'et_pb_toggle_item' );
[468] Fix | Delete
}
[469] Fix | Delete
[470] Fix | Delete
$video_background = $this->video_background();
[471] Fix | Delete
$parallax_image_background = $this->get_parallax_image_background();
[472] Fix | Delete
[473] Fix | Delete
$heading = $multi_view->render_element( array(
[474] Fix | Delete
'tag' => et_pb_process_header_level( $header_level, 'h5' ),
[475] Fix | Delete
'content' => '{{title}}',
[476] Fix | Delete
'attrs' => array(
[477] Fix | Delete
'class' => 'et_pb_toggle_title',
[478] Fix | Delete
),
[479] Fix | Delete
'required' => false,
[480] Fix | Delete
) );
[481] Fix | Delete
[482] Fix | Delete
$multi_view_content = $multi_view->render_attrs( array(
[483] Fix | Delete
'content' => '{{content}}',
[484] Fix | Delete
) );
[485] Fix | Delete
[486] Fix | Delete
// Module classnames
[487] Fix | Delete
$this->add_classname( array(
[488] Fix | Delete
$this->get_text_orientation_classname(),
[489] Fix | Delete
) );
[490] Fix | Delete
[491] Fix | Delete
if ( 'on' === $open ) {
[492] Fix | Delete
$this->add_classname( 'et_pb_toggle_open' );
[493] Fix | Delete
} else {
[494] Fix | Delete
$this->add_classname( 'et_pb_toggle_close' );
[495] Fix | Delete
}
[496] Fix | Delete
[497] Fix | Delete
$output = sprintf(
[498] Fix | Delete
'<div%4$s class="%2$s">
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function