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/woocomme...
File: Images.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WooCommerce Modules: ET_Builder_Module_Woocommerce_Images class
[2] Fix | Delete
*
[3] Fix | Delete
* The ET_Builder_Module_Woocommerce_Images Class is responsible for rendering the
[4] Fix | Delete
* Image markup using the WooCommerce template.
[5] Fix | Delete
*
[6] Fix | Delete
* @package Divi\Builder
[7] Fix | Delete
*
[8] Fix | Delete
* @since 3.29
[9] Fix | Delete
*/
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Class representing WooCommerce Images component.
[13] Fix | Delete
*/
[14] Fix | Delete
class ET_Builder_Module_Woocommerce_Images extends ET_Builder_Module {
[15] Fix | Delete
/**
[16] Fix | Delete
* Initialize.
[17] Fix | Delete
*/
[18] Fix | Delete
public function init() {
[19] Fix | Delete
$this->name = esc_html__( 'Woo Images', 'et_builder' );
[20] Fix | Delete
$this->slug = 'et_pb_wc_images';
[21] Fix | Delete
$this->vb_support = 'on';
[22] Fix | Delete
[23] Fix | Delete
$this->settings_modal_toggles = array(
[24] Fix | Delete
'general' => array(
[25] Fix | Delete
'toggles' => array(
[26] Fix | Delete
'main_content' => et_builder_i18n( 'Content' ),
[27] Fix | Delete
'elements' => et_builder_i18n( 'Elements' ),
[28] Fix | Delete
),
[29] Fix | Delete
),
[30] Fix | Delete
'advanced' => array(
[31] Fix | Delete
'toggles' => array(
[32] Fix | Delete
'image' => et_builder_i18n( 'Image' ),
[33] Fix | Delete
),
[34] Fix | Delete
),
[35] Fix | Delete
);
[36] Fix | Delete
[37] Fix | Delete
$this->advanced_fields = array(
[38] Fix | Delete
'borders' => array(
[39] Fix | Delete
'default' => array(),
[40] Fix | Delete
'image' => array(
[41] Fix | Delete
'css' => array(
[42] Fix | Delete
'main' => array(
[43] Fix | Delete
'border_radii' => '%%order_class%% div.images ol.flex-control-thumbs.flex-control-nav li, %%order_class%% .flex-viewport, %%order_class%% .woocommerce-product-gallery--without-images .woocommerce-product-gallery__wrapper, %%order_class%% .woocommerce-product-gallery > div:not(.flex-viewport) .woocommerce-product-gallery__image, %%order_class%% .woocommerce-product-gallery > .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image, %%order_class%% .woocommerce-product-gallery .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image',
[44] Fix | Delete
'border_styles' => '%%order_class%% div.images ol.flex-control-thumbs.flex-control-nav li, %%order_class%% .flex-viewport, %%order_class%% .woocommerce-product-gallery--without-images .woocommerce-product-gallery__wrapper, %%order_class%% .woocommerce-product-gallery > div:not(.flex-viewport) .woocommerce-product-gallery__image, %%order_class%% .woocommerce-product-gallery > .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image',
[45] Fix | Delete
),
[46] Fix | Delete
),
[47] Fix | Delete
'label_prefix' => et_builder_i18n( 'Image' ),
[48] Fix | Delete
'tab_slug' => 'advanced',
[49] Fix | Delete
'toggle_slug' => 'image',
[50] Fix | Delete
),
[51] Fix | Delete
),
[52] Fix | Delete
'box_shadow' => array(
[53] Fix | Delete
'default' => array(),
[54] Fix | Delete
'image' => array(
[55] Fix | Delete
'label' => esc_html__( 'Image Box Shadow', 'et_builder' ),
[56] Fix | Delete
'option_category' => 'layout',
[57] Fix | Delete
'tab_slug' => 'advanced',
[58] Fix | Delete
'toggle_slug' => 'image',
[59] Fix | Delete
'css' => array(
[60] Fix | Delete
'main' => '%%order_class%% div.images ol.flex-control-thumbs.flex-control-nav li, %%order_class%% .flex-viewport, %%order_class%% .woocommerce-product-gallery--without-images .woocommerce-product-gallery__wrapper, %%order_class%% .woocommerce-product-gallery > div:not(.flex-viewport) .woocommerce-product-gallery__image, %%order_class%% .woocommerce-product-gallery > .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image',
[61] Fix | Delete
'overlay' => 'inset',
[62] Fix | Delete
'important' => true,
[63] Fix | Delete
),
[64] Fix | Delete
),
[65] Fix | Delete
),
[66] Fix | Delete
'background' => array(),
[67] Fix | Delete
'margin_padding' => array(
[68] Fix | Delete
'css' => array(
[69] Fix | Delete
'important' => 'all',
[70] Fix | Delete
),
[71] Fix | Delete
),
[72] Fix | Delete
'text_shadow' => array(),
[73] Fix | Delete
'text' => false,
[74] Fix | Delete
'fonts' => array(
[75] Fix | Delete
'sale_badge' => array(
[76] Fix | Delete
'label' => esc_html__( 'Sale Badge', 'et_builder' ),
[77] Fix | Delete
'css' => array(
[78] Fix | Delete
'main' => "%%order_class%% .et_pb_module_inner span.onsale",
[79] Fix | Delete
'important' => 'all',
[80] Fix | Delete
),
[81] Fix | Delete
'hide_text_align' => true,
[82] Fix | Delete
'line_height' => array(
[83] Fix | Delete
'default' => '1.7em',
[84] Fix | Delete
),
[85] Fix | Delete
'font_size' => array(
[86] Fix | Delete
'default' => '20px',
[87] Fix | Delete
),
[88] Fix | Delete
'letter_spacing' => array(
[89] Fix | Delete
'default' => '0px',
[90] Fix | Delete
),
[91] Fix | Delete
),
[92] Fix | Delete
),
[93] Fix | Delete
'button' => false,
[94] Fix | Delete
);
[95] Fix | Delete
[96] Fix | Delete
$this->help_videos = array(
[97] Fix | Delete
array(
[98] Fix | Delete
'id' => '7X03vBPYJ1o',
[99] Fix | Delete
'name' => esc_html__( 'Divi WooCommerce Modules', 'et_builder' ),
[100] Fix | Delete
),
[101] Fix | Delete
);
[102] Fix | Delete
}
[103] Fix | Delete
[104] Fix | Delete
/**
[105] Fix | Delete
* {@inheritdoc}
[106] Fix | Delete
*/
[107] Fix | Delete
public function get_fields() {
[108] Fix | Delete
$fields = array(
[109] Fix | Delete
'product' => ET_Builder_Module_Helper_Woocommerce_Modules::get_field(
[110] Fix | Delete
'product',
[111] Fix | Delete
array(
[112] Fix | Delete
'default' => ET_Builder_Module_Helper_Woocommerce_Modules::get_product_default(),
[113] Fix | Delete
'computed_affects' => array(
[114] Fix | Delete
'__images',
[115] Fix | Delete
),
[116] Fix | Delete
)
[117] Fix | Delete
),
[118] Fix | Delete
'product_filter' => ET_Builder_Module_Helper_Woocommerce_Modules::get_field(
[119] Fix | Delete
'product_filter',
[120] Fix | Delete
array(
[121] Fix | Delete
'computed_affects' => array(
[122] Fix | Delete
'__images',
[123] Fix | Delete
),
[124] Fix | Delete
)
[125] Fix | Delete
),
[126] Fix | Delete
'show_product_image' => array(
[127] Fix | Delete
'label' => esc_html__( 'Show Featured Image', 'et_builder' ),
[128] Fix | Delete
'type' => 'yes_no_button',
[129] Fix | Delete
'option_category' => 'configuration',
[130] Fix | Delete
'options' => array(
[131] Fix | Delete
'on' => et_builder_i18n( 'On' ),
[132] Fix | Delete
'off' => et_builder_i18n( 'Off' ),
[133] Fix | Delete
),
[134] Fix | Delete
'default_on_front' => 'on',
[135] Fix | Delete
'toggle_slug' => 'elements',
[136] Fix | Delete
'description' => esc_html__( 'Here you can choose whether product image should be displayed or not.', 'et_builder' ),
[137] Fix | Delete
'computed_affects' => array(
[138] Fix | Delete
'__images',
[139] Fix | Delete
),
[140] Fix | Delete
),
[141] Fix | Delete
'show_product_gallery' => array(
[142] Fix | Delete
'label' => esc_html__( 'Show Gallery Images', 'et_builder' ),
[143] Fix | Delete
'type' => 'yes_no_button',
[144] Fix | Delete
'option_category' => 'configuration',
[145] Fix | Delete
'options' => array(
[146] Fix | Delete
'on' => et_builder_i18n( 'On' ),
[147] Fix | Delete
'off' => et_builder_i18n( 'Off' ),
[148] Fix | Delete
),
[149] Fix | Delete
'default_on_front' => 'on',
[150] Fix | Delete
'toggle_slug' => 'elements',
[151] Fix | Delete
'description' => esc_html__( 'Here you can choose whether product gallery should be displayed or not.', 'et_builder' ),
[152] Fix | Delete
'computed_affects' => array(
[153] Fix | Delete
'__images',
[154] Fix | Delete
),
[155] Fix | Delete
),
[156] Fix | Delete
'show_sale_badge' => array(
[157] Fix | Delete
'label' => esc_html__( 'Show Sale Badge', 'et_builder' ),
[158] Fix | Delete
'type' => 'yes_no_button',
[159] Fix | Delete
'option_category' => 'configuration',
[160] Fix | Delete
'options' => array(
[161] Fix | Delete
'on' => et_builder_i18n( 'On' ),
[162] Fix | Delete
'off' => et_builder_i18n( 'Off' ),
[163] Fix | Delete
),
[164] Fix | Delete
'default_on_front' => 'on',
[165] Fix | Delete
'toggle_slug' => 'elements',
[166] Fix | Delete
'description' => esc_html__( 'Here you can choose whether Sale Badge should be displayed or not.', 'et_builder' ),
[167] Fix | Delete
'computed_affects' => array(
[168] Fix | Delete
'__images',
[169] Fix | Delete
),
[170] Fix | Delete
),
[171] Fix | Delete
'sale_badge_color' => array(
[172] Fix | Delete
'label' => esc_html__( 'Sale Badge Color', 'et_builder' ),
[173] Fix | Delete
'description' => esc_html__( 'Pick a color to use for the sales bade that appears on products that are on sale.', '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' => 'sale_badge',
[178] Fix | Delete
'hover' => 'tabs',
[179] Fix | Delete
'mobile_options' => true,
[180] Fix | Delete
),
[181] Fix | Delete
'__images' => array(
[182] Fix | Delete
'type' => 'computed',
[183] Fix | Delete
'computed_callback' => array(
[184] Fix | Delete
'ET_Builder_Module_Woocommerce_Images',
[185] Fix | Delete
'get_images',
[186] Fix | Delete
),
[187] Fix | Delete
'computed_depends_on' => array(
[188] Fix | Delete
'product',
[189] Fix | Delete
'product_filter',
[190] Fix | Delete
'show_product_image',
[191] Fix | Delete
'show_product_gallery',
[192] Fix | Delete
'show_sale_badge',
[193] Fix | Delete
),
[194] Fix | Delete
'computed_minimum' => array(
[195] Fix | Delete
'product',
[196] Fix | Delete
),
[197] Fix | Delete
),
[198] Fix | Delete
'force_fullwidth' => array(
[199] Fix | Delete
'label' => esc_html__( 'Force Fullwidth', 'et_builder' ),
[200] Fix | Delete
'description' => esc_html__( "When enabled, this will force your image to extend 100% of the width of the column it's in.", 'et_builder' ),
[201] Fix | Delete
'type' => 'yes_no_button',
[202] Fix | Delete
'option_category' => 'layout',
[203] Fix | Delete
'options' => array(
[204] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[205] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[206] Fix | Delete
),
[207] Fix | Delete
'default' => 'off',
[208] Fix | Delete
'tab_slug' => 'advanced',
[209] Fix | Delete
'toggle_slug' => 'image',
[210] Fix | Delete
'affects' => array(
[211] Fix | Delete
'max_width',
[212] Fix | Delete
'width',
[213] Fix | Delete
),
[214] Fix | Delete
),
[215] Fix | Delete
);
[216] Fix | Delete
[217] Fix | Delete
return $fields;
[218] Fix | Delete
}
[219] Fix | Delete
[220] Fix | Delete
/**
[221] Fix | Delete
* Get images output
[222] Fix | Delete
*
[223] Fix | Delete
* @since 3.29
[224] Fix | Delete
*
[225] Fix | Delete
* @param array $args Additional args.
[226] Fix | Delete
*
[227] Fix | Delete
* @return string
[228] Fix | Delete
*/
[229] Fix | Delete
public static function get_images( $args = array() ) {
[230] Fix | Delete
$defaults = array(
[231] Fix | Delete
'product' => 'current',
[232] Fix | Delete
'show_product_image' => 'on',
[233] Fix | Delete
'show_product_gallery' => 'on',
[234] Fix | Delete
'show_sale_badge' => 'on',
[235] Fix | Delete
);
[236] Fix | Delete
$args = wp_parse_args( $args, $defaults );
[237] Fix | Delete
[238] Fix | Delete
$images = et_builder_wc_render_module_template(
[239] Fix | Delete
'woocommerce_show_product_images',
[240] Fix | Delete
$args
[241] Fix | Delete
);
[242] Fix | Delete
[243] Fix | Delete
return $images;
[244] Fix | Delete
}
[245] Fix | Delete
[246] Fix | Delete
/**
[247] Fix | Delete
* Renders the module output.
[248] Fix | Delete
*
[249] Fix | Delete
* @param array $attrs List of attributes.
[250] Fix | Delete
* @param string $content Content being processed.
[251] Fix | Delete
* @param string $render_slug Slug of module that is used for rendering output.
[252] Fix | Delete
*
[253] Fix | Delete
* @return string
[254] Fix | Delete
*/
[255] Fix | Delete
public function render( $attrs, $content = null, $render_slug ) {
[256] Fix | Delete
ET_Builder_Module_Helper_Woocommerce_Modules::process_background_layout_data( $render_slug, $this );
[257] Fix | Delete
[258] Fix | Delete
$sale_badge_color_hover = $this->get_hover_value( 'sale_badge_color' );
[259] Fix | Delete
$sale_badge_color_values = et_pb_responsive_options()->get_property_values( $this->props, 'sale_badge_color' );
[260] Fix | Delete
$force_fullwidth = et_()->array_get( $this->props, 'force_fullwidth', 'off' );
[261] Fix | Delete
[262] Fix | Delete
// Sale Badge Color.
[263] Fix | Delete
et_pb_responsive_options()->generate_responsive_css( $sale_badge_color_values, '%%order_class%% span.onsale', 'background-color', $render_slug, ' !important;', 'color' );
[264] Fix | Delete
[265] Fix | Delete
if ( et_builder_is_hover_enabled( 'sale_badge_color', $this->props ) ) {
[266] Fix | Delete
ET_Builder_Element::set_style(
[267] Fix | Delete
$render_slug,
[268] Fix | Delete
array(
[269] Fix | Delete
'selector' => '%%order_class%%:hover span.onsale',
[270] Fix | Delete
'declaration' => sprintf(
[271] Fix | Delete
'background-color: %1$s !important;',
[272] Fix | Delete
esc_html( $sale_badge_color_hover )
[273] Fix | Delete
),
[274] Fix | Delete
)
[275] Fix | Delete
);
[276] Fix | Delete
}
[277] Fix | Delete
[278] Fix | Delete
// Image force fullwidth.
[279] Fix | Delete
if ( 'on' === $force_fullwidth ) {
[280] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[281] Fix | Delete
'selector' => '%%order_class%% .woocommerce-product-gallery__image img',
[282] Fix | Delete
'declaration' => 'width: 100%;',
[283] Fix | Delete
) );
[284] Fix | Delete
}
[285] Fix | Delete
[286] Fix | Delete
$output = self::get_images( $this->props );
[287] Fix | Delete
[288] Fix | Delete
return $this->_render_module_wrapper( $output, $render_slug );
[289] Fix | Delete
}
[290] Fix | Delete
}
[291] Fix | Delete
[292] Fix | Delete
new ET_Builder_Module_Woocommerce_Images();
[293] Fix | Delete
[294] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function