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