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: BarCounters.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class ET_Builder_Module_Bar_Counters extends ET_Builder_Module {
[2] Fix | Delete
function init() {
[3] Fix | Delete
$this->name = esc_html__( 'Bar Counters', 'et_builder' );
[4] Fix | Delete
$this->plural = esc_html__( 'Bar Counters', 'et_builder' );
[5] Fix | Delete
$this->slug = 'et_pb_counters';
[6] Fix | Delete
$this->vb_support = 'on';
[7] Fix | Delete
$this->child_slug = 'et_pb_counter';
[8] Fix | Delete
$this->child_item_text = esc_html__( 'Bar Counter', 'et_builder' );
[9] Fix | Delete
[10] Fix | Delete
$this->main_css_element = '%%order_class%%.et_pb_counters';
[11] Fix | Delete
[12] Fix | Delete
$this->settings_modal_toggles = array(
[13] Fix | Delete
'general' => array(
[14] Fix | Delete
'toggles' => array(
[15] Fix | Delete
'elements' => et_builder_i18n( 'Elements' ),
[16] Fix | Delete
),
[17] Fix | Delete
),
[18] Fix | Delete
'advanced' => array(
[19] Fix | Delete
'toggles' => array(
[20] Fix | Delete
'layout' => et_builder_i18n( 'Layout' ),
[21] Fix | Delete
'text' => array(
[22] Fix | Delete
'title' => et_builder_i18n( 'Text' ),
[23] Fix | Delete
'priority' => 49,
[24] Fix | Delete
),
[25] Fix | Delete
'bar' => esc_html__( 'Bar', 'et_builder' ),
[26] Fix | Delete
),
[27] Fix | Delete
),
[28] Fix | Delete
);
[29] Fix | Delete
[30] Fix | Delete
$this->advanced_fields = array(
[31] Fix | Delete
'borders' => array(
[32] Fix | Delete
'default' => array(
[33] Fix | Delete
'css' => array(
[34] Fix | Delete
'main' => array(
[35] Fix | Delete
'border_radii' => "%%order_class%% .et_pb_counter_container, %%order_class%% .et_pb_counter_amount",
[36] Fix | Delete
'border_styles' => "%%order_class%% .et_pb_counter_container",
[37] Fix | Delete
),
[38] Fix | Delete
),
[39] Fix | Delete
),
[40] Fix | Delete
),
[41] Fix | Delete
'box_shadow' => array(
[42] Fix | Delete
'default' => array(
[43] Fix | Delete
'css' => array(
[44] Fix | Delete
'main' => '%%order_class%% .et_pb_counter_container',
[45] Fix | Delete
'overlay' => 'inset',
[46] Fix | Delete
),
[47] Fix | Delete
),
[48] Fix | Delete
),
[49] Fix | Delete
'fonts' => array(
[50] Fix | Delete
'title' => array(
[51] Fix | Delete
'label' => et_builder_i18n( 'Title' ),
[52] Fix | Delete
'css' => array(
[53] Fix | Delete
'main' => "{$this->main_css_element} .et_pb_counter_title",
[54] Fix | Delete
),
[55] Fix | Delete
),
[56] Fix | Delete
'percent' => array(
[57] Fix | Delete
'label' => esc_html__( 'Percentage', 'et_builder' ),
[58] Fix | Delete
'css' => array(
[59] Fix | Delete
'main' => "{$this->main_css_element} .et_pb_counter_amount_number",
[60] Fix | Delete
'text_align' => "{$this->main_css_element} .et_pb_counter_amount",
[61] Fix | Delete
),
[62] Fix | Delete
),
[63] Fix | Delete
),
[64] Fix | Delete
'background' => array(
[65] Fix | Delete
'use_background_color' => 'fields_only',
[66] Fix | Delete
'css' => array(
[67] Fix | Delete
'main' => "{$this->main_css_element} .et_pb_counter_container",
[68] Fix | Delete
),
[69] Fix | Delete
'options' => array(
[70] Fix | Delete
'background_color' => array(
[71] Fix | Delete
'default' => '',
[72] Fix | Delete
),
[73] Fix | Delete
),
[74] Fix | Delete
),
[75] Fix | Delete
'margin_padding' => array(
[76] Fix | Delete
'draggable_padding' => false,
[77] Fix | Delete
'css' => array(
[78] Fix | Delete
'margin' => "{$this->main_css_element}",
[79] Fix | Delete
'padding' => "{$this->main_css_element} .et_pb_counter_amount",
[80] Fix | Delete
'important' => array( 'custom_margin' ),
[81] Fix | Delete
),
[82] Fix | Delete
),
[83] Fix | Delete
'text' => array(
[84] Fix | Delete
'use_background_layout' => true,
[85] Fix | Delete
'options' => array(
[86] Fix | Delete
'background_layout' => array(
[87] Fix | Delete
'default_on_front' => 'light',
[88] Fix | Delete
'hover' => 'tabs',
[89] Fix | Delete
),
[90] Fix | Delete
),
[91] Fix | Delete
),
[92] Fix | Delete
'filters' => array(
[93] Fix | Delete
'css' => array(
[94] Fix | Delete
'main' => '%%order_class%%',
[95] Fix | Delete
),
[96] Fix | Delete
),
[97] Fix | Delete
'scroll_effects' => array(
[98] Fix | Delete
'grid_support' => 'yes',
[99] Fix | Delete
),
[100] Fix | Delete
'button' => false,
[101] Fix | Delete
);
[102] Fix | Delete
[103] Fix | Delete
$this->custom_css_fields = array(
[104] Fix | Delete
'counter_title' => array(
[105] Fix | Delete
'label' => esc_html__( 'Counter Title', 'et_builder' ),
[106] Fix | Delete
'selector' => '.et_pb_counter_title',
[107] Fix | Delete
),
[108] Fix | Delete
'counter_container' => array(
[109] Fix | Delete
'label' => esc_html__( 'Counter Container', 'et_builder' ),
[110] Fix | Delete
'selector' => '.et_pb_counter_container',
[111] Fix | Delete
),
[112] Fix | Delete
'counter_amount' => array(
[113] Fix | Delete
'label' => esc_html__( 'Counter Amount', 'et_builder' ),
[114] Fix | Delete
'selector' => '.et_pb_counter_amount',
[115] Fix | Delete
),
[116] Fix | Delete
);
[117] Fix | Delete
[118] Fix | Delete
$this->help_videos = array(
[119] Fix | Delete
array(
[120] Fix | Delete
'id' => '2QLX8Lwr3cs',
[121] Fix | Delete
'name' => esc_html__( 'An introduction to the Bar Counter module', 'et_builder' ),
[122] Fix | Delete
),
[123] Fix | Delete
);
[124] Fix | Delete
}
[125] Fix | Delete
[126] Fix | Delete
function get_fields() {
[127] Fix | Delete
$fields = array(
[128] Fix | Delete
'bar_bg_color' => array(
[129] Fix | Delete
'label' => esc_html__( 'Bar Background Color', 'et_builder' ),
[130] Fix | Delete
'type' => 'color-alpha',
[131] Fix | Delete
'tab_slug' => 'advanced',
[132] Fix | Delete
'toggle_slug' => 'bar',
[133] Fix | Delete
'hover' => 'tabs',
[134] Fix | Delete
'description' => esc_html__( 'This will change the fill color for the bar.', 'et_builder' ),
[135] Fix | Delete
'default' => et_builder_accent_color(),
[136] Fix | Delete
'mobile_options' => true,
[137] Fix | Delete
),
[138] Fix | Delete
'use_percentages' => array(
[139] Fix | Delete
'label' => esc_html__( 'Show Percentage', 'et_builder' ),
[140] Fix | Delete
'description' => esc_html__( 'Turning off percentages will remove the percentage text from within the filled portion of the bar.', 'et_builder' ),
[141] Fix | Delete
'type' => 'yes_no_button',
[142] Fix | Delete
'option_category' => 'configuration',
[143] Fix | Delete
'options' => array(
[144] Fix | Delete
'on' => et_builder_i18n( 'On' ),
[145] Fix | Delete
'off' => et_builder_i18n( 'Off' ),
[146] Fix | Delete
),
[147] Fix | Delete
'toggle_slug' => 'elements',
[148] Fix | Delete
'default_on_front' => 'on',
[149] Fix | Delete
'mobile_options' => true,
[150] Fix | Delete
'hover' => 'tabs',
[151] Fix | Delete
),
[152] Fix | Delete
);
[153] Fix | Delete
[154] Fix | Delete
return $fields;
[155] Fix | Delete
}
[156] Fix | Delete
[157] Fix | Delete
public function get_transition_fields_css_props() {
[158] Fix | Delete
$fields = parent::get_transition_fields_css_props();
[159] Fix | Delete
[160] Fix | Delete
$fields['background_layout'] = array( 'color' => '%%order_class%% .et_pb_counter_title' );
[161] Fix | Delete
$fields['bar_bg_color'] = array( 'background-color' => '%%order_class%% .et_pb_counter_amount' );
[162] Fix | Delete
[163] Fix | Delete
return $fields;
[164] Fix | Delete
}
[165] Fix | Delete
[166] Fix | Delete
function before_render() {
[167] Fix | Delete
global $et_pb_counters_settings;
[168] Fix | Delete
[169] Fix | Delete
$multi_view = et_pb_multi_view_options( $this );
[170] Fix | Delete
$background_image = $this->props['background_image'];
[171] Fix | Delete
$parallax = $this->props['parallax'];
[172] Fix | Delete
$parallax_method = $this->props['parallax_method'];
[173] Fix | Delete
$background_video_mp4 = $this->props['background_video_mp4'];
[174] Fix | Delete
$background_video_webm = $this->props['background_video_webm'];
[175] Fix | Delete
$background_video_width = $this->props['background_video_width'];
[176] Fix | Delete
$background_video_height = $this->props['background_video_height'];
[177] Fix | Delete
$allow_player_pause = $this->props['allow_player_pause'];
[178] Fix | Delete
$bar_bg_color_values = et_pb_responsive_options()->get_property_values( $this->props, 'bar_bg_color' );
[179] Fix | Delete
$background_video_pause_outside_viewport = $this->props['background_video_pause_outside_viewport'];
[180] Fix | Delete
$use_background_color_gradient = $this->props['use_background_color_gradient'];
[181] Fix | Delete
[182] Fix | Delete
// Background Color.
[183] Fix | Delete
$background_last_edited = self::$_->array_get( $this->props, 'background_last_edited', '' );
[184] Fix | Delete
$background_hover_enabled = self::$_->array_get( $this->props, 'background__hover_enabled', '' );
[185] Fix | Delete
$background_colors = et_pb_responsive_options()->get_composite_property_values( $this->props, 'background', 'background_color' );
[186] Fix | Delete
$background_enable_colors = et_pb_responsive_options()->get_composite_property_values( $this->props, 'background', 'background_enable_color' );
[187] Fix | Delete
$background_color_hover = et_pb_hover_options()->get_compose_value( 'background_color', 'background', $this->props, '' );
[188] Fix | Delete
$background_enable_color_hover = et_pb_hover_options()->get_compose_value( 'background_enable_color', 'background', $this->props, '' );
[189] Fix | Delete
[190] Fix | Delete
$et_pb_counters_settings = array(
[191] Fix | Delete
// Background Color.
[192] Fix | Delete
'background_last_edited' => $background_last_edited,
[193] Fix | Delete
'background__hover_enabled' => $background_hover_enabled,
[194] Fix | Delete
'background_color' => $background_colors['desktop'],
[195] Fix | Delete
'background_color_tablet' => $background_colors['tablet'],
[196] Fix | Delete
'background_color_phone' => $background_colors['phone'],
[197] Fix | Delete
'background_enable_color' => $background_enable_colors['desktop'],
[198] Fix | Delete
'background_enable_color_tablet' => $background_enable_colors['tablet'],
[199] Fix | Delete
'background_enable_color_phone' => $background_enable_colors['phone'],
[200] Fix | Delete
'background_color_hover' => $background_color_hover,
[201] Fix | Delete
'background_color__hover' => $background_color_hover,
[202] Fix | Delete
'background_enable_color__hover' => $background_enable_color_hover,
[203] Fix | Delete
'background_image' => $background_image,
[204] Fix | Delete
'parallax' => $parallax,
[205] Fix | Delete
'parallax_method' => $parallax_method,
[206] Fix | Delete
'background_video_mp4' => $background_video_mp4,
[207] Fix | Delete
'background_video_webm' => $background_video_webm,
[208] Fix | Delete
'background_video_width' => $background_video_width,
[209] Fix | Delete
'background_video_height' => $background_video_height,
[210] Fix | Delete
'allow_player_pause' => $allow_player_pause,
[211] Fix | Delete
'bar_bg_color' => isset( $bar_bg_color_values['desktop'] ) ? $bar_bg_color_values['desktop'] : '',
[212] Fix | Delete
'bar_bg_color_tablet' => isset( $bar_bg_color_values['tablet'] ) ? $bar_bg_color_values['tablet'] : '',
[213] Fix | Delete
'bar_bg_color_phone' => isset( $bar_bg_color_values['phone'] ) ? $bar_bg_color_values['phone'] : '',
[214] Fix | Delete
'use_percentages' => $multi_view->get_values( 'use_percentages' ),
[215] Fix | Delete
'background_video_pause_outside_viewport' => $background_video_pause_outside_viewport,
[216] Fix | Delete
'use_background_color_gradient' => $use_background_color_gradient,
[217] Fix | Delete
);
[218] Fix | Delete
}
[219] Fix | Delete
[220] Fix | Delete
function render( $attrs, $content = null, $render_slug ) {
[221] Fix | Delete
$bar_bg_hover_color = et_pb_hover_options()->get_value( 'bar_bg_color', $this->props );
[222] Fix | Delete
$video_background = $this->video_background();
[223] Fix | Delete
[224] Fix | Delete
// Module classname
[225] Fix | Delete
$this->add_classname( array(
[226] Fix | Delete
'et-waypoint',
[227] Fix | Delete
) );
[228] Fix | Delete
[229] Fix | Delete
// Background layout class names.
[230] Fix | Delete
$background_layout_class_names = et_pb_background_layout_options()->get_background_layout_class( $this->props );
[231] Fix | Delete
$this->add_classname( $background_layout_class_names );
[232] Fix | Delete
[233] Fix | Delete
$this->add_classname( $this->get_text_orientation_classname() );
[234] Fix | Delete
[235] Fix | Delete
// Background layout data attributes.
[236] Fix | Delete
$data_background_layout = et_pb_background_layout_options()->get_background_layout_attrs( $this->props );
[237] Fix | Delete
[238] Fix | Delete
if ( ! empty( $bar_bg_hover_color ) ) {
[239] Fix | Delete
self::set_style( $render_slug,
[240] Fix | Delete
array(
[241] Fix | Delete
'selector' => '%%order_class%%:hover .et_pb_counter_amount',
[242] Fix | Delete
'declaration' => sprintf( 'background-color: %1$s;', esc_attr( $bar_bg_hover_color ) ),
[243] Fix | Delete
) );
[244] Fix | Delete
}
[245] Fix | Delete
[246] Fix | Delete
$output = sprintf(
[247] Fix | Delete
'<ul%3$s class="%2$s"%4$s>
[248] Fix | Delete
%1$s
[249] Fix | Delete
</ul> <!-- .et_pb_counters -->',
[250] Fix | Delete
$this->content,
[251] Fix | Delete
$this->module_classname( $render_slug ),
[252] Fix | Delete
$this->module_id(),
[253] Fix | Delete
et_core_esc_previously( $data_background_layout )
[254] Fix | Delete
);
[255] Fix | Delete
[256] Fix | Delete
return $output;
[257] Fix | Delete
}
[258] Fix | Delete
}
[259] Fix | Delete
[260] Fix | Delete
new ET_Builder_Module_Bar_Counters;
[261] Fix | Delete
[262] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function