PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.0.1
ShopBuilder – WooCommerce Builder For Elementor v2.0.1
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 2.0.1, at app/Controllers/PluginsSupport/RtwpvgSupport.php

70 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\Helpers\ElementorDataMap;
12 use RadiusTheme\SB\Traits\SingletonTrait;
13 use RadiusTheme\SB\Helpers\BuilderFns;
14
15 // Do not allow directly accessing this file.
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit( 'This script cannot be accessed directly.' );
18 }
19
20 /**
21 * Product Description class
22 */
23 class RtwpvgSupport {
24 /**
25 * SingletonTrait.
26 */
27 use SingletonTrait;
28
29 /**
30 * Construct function
31 */
32 private function __construct() {
33 add_action( 'wp_enqueue_scripts', [ $this, 'support_assets' ], -1 );
34 add_filter( 'rtsb/elements/elementor/widget/selectors/rtsb-product-image', [ $this, 'rtsb_product_image_selectors' ] );
35 }
36 /**
37 * Undocumented function
38 *
39 * @return void
40 */
41 public function support_assets() {
42 if ( ! BuilderFns::is_builder_preview() ) {
43 return;
44 }
45 $hooks = [
46 'rtwpvg_disable_enqueue_scripts',
47 'rtwpvg_disable_inline_style',
48 ];
49 foreach ( $hooks as $hook ) {
50 add_filter( $hook, '__return_false', 20 );
51 }
52 wp_enqueue_style( 'rtwpvg' );
53 wp_enqueue_script( 'rtwpvg' );
54 }
55
56 /**
57 * Product Image Selector
58 *
59 * @param array $selectors Image Selector.
60 * @return array
61 */
62 public function rtsb_product_image_selectors( $selectors ) {
63 $selectors['image_width'] = $selectors['image_width'] . ',{{WRAPPER}} .rtsb-product-images .rtwpvg-single-image-container img';
64 $selectors['image_border_radius'] = $selectors['image_width'] . ',{{WRAPPER}} .rtsb-product-images .rtwpvg-single-image-container img';
65 return $selectors;
66 }
67
68
69 }
70