PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 1.1.0
ShopBuilder – WooCommerce Builder For Elementor v1.1.0
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Controllers / PluginsSupport / RtwpvgSupport.php

RtwpvgSupport.php in ShopBuilder – WooCommerce Builder For Elementor 1.1.0, at app/Controllers/PluginsSupport/RtwpvgSupport.php

68 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Radiustheme Variation Gallery support.
5 *
6 * @package RadiusTheme\SB
7 */
8
9 namespace RadiusTheme\SB\Controllers\PluginsSupport;
10
11 use RadiusTheme\SB\Traits\SingletonTrait;
12 use RadiusTheme\SB\Helpers\BuilderFns;
13
14 // Do not allow directly accessing this file.
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit( 'This script cannot be accessed directly.' );
17 }
18
19 /**
20 * Product Description class
21 */
22 class RtwpvgSupport {
23 /**
24 * SingletonTrait.
25 */
26 use SingletonTrait;
27
28 /**
29 * Construct function
30 */
31 private function __construct() {
32 add_action( 'wp_enqueue_scripts', [ $this, 'support_assets' ], -1 );
33 add_filter( 'rtsb/elements/elementor/widget/selectors/rtsb-product-image', [ $this, 'rtsb_product_image_selectors' ] );
34 }
35 /**
36 * Undocumented function
37 *
38 * @return void
39 */
40 public function support_assets() {
41 if ( ! BuilderFns::is_builder_preview() ) {
42 return;
43 }
44 $hooks = [
45 'rtwpvg_disable_enqueue_scripts',
46 'rtwpvg_disable_inline_style',
47 ];
48 foreach ( $hooks as $hook ) {
49 add_filter( $hook, '__return_false', 20 );
50 }
51 wp_enqueue_style( 'rtwpvg' );
52 wp_enqueue_script( 'rtwpvg' );
53 }
54
55 /**
56 * Product Image Selector
57 *
58 * @param array $selectors Image Selector.
59 * @return array
60 */
61 public function rtsb_product_image_selectors( $selectors ) {
62 $selectors['image_width'] = $selectors['image_width'] . ',{{WRAPPER}} .rtsb-product-images .rtwpvg-single-image-container img';
63 $selectors['image_border_radius'] = $selectors['image_width'] . ',{{WRAPPER}} .rtsb-product-images .rtwpvg-single-image-container img';
64 return $selectors;
65 }
66
67 }
68