| @@ -1,81 +1,67 @@ | ||
| 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_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 16 ); | |
| 35 | - add_filter( 'rtsb/elements/elementor/widget/selectors/rtsb-product-image', [ $this, 'rtsb_product_image_selectors' ] ); | |
| 36 | - | |
| 37 | - } | |
| 38 | - /** | |
| 39 | - * Undocumented function | |
| 40 | - * | |
| 41 | - * @return void | |
| 42 | - */ | |
| 43 | - public function enqueue_scripts() { | |
| 44 | - // wp_dequeue_script( 'rtwpvg' ); | |
| 45 | - // wp_dequeue_script( 'swiper' ); | |
| 46 | - | |
| 47 | - // wp_enqueue_script( 'rtwpvg' ); | |
| 48 | - } | |
| 49 | - | |
| 50 | - /** | |
| 51 | - * Undocumented function | |
| 52 | - * | |
| 53 | - * @return void | |
| 54 | - */ | |
| 55 | - public function support_assets() { | |
| 56 | - if ( ! BuilderFns::is_builder_preview() ) { | |
| 57 | - return; | |
| 58 | - } | |
| 59 | - $hooks = [ | |
| 60 | - 'rtwpvg_disable_enqueue_scripts', | |
| 61 | - 'rtwpvg_disable_inline_style', | |
| 62 | - ]; | |
| 63 | - foreach ( $hooks as $hook ) { | |
| 64 | - add_filter( $hook, '__return_false', 20 ); | |
| 65 | - } | |
| 66 | - } | |
| 67 | - | |
| 68 | - /** | |
| 69 | - * Product Image Selector | |
| 70 | - * | |
| 71 | - * @param array $selectors Image Selector. | |
| 72 | - * @return array | |
| 73 | - */ | |
| 74 | - public function rtsb_product_image_selectors( $selectors ) { | |
| 75 | - $selectors['image_width'] = $selectors['image_width'] . ',{{WRAPPER}} .rtsb-product-images .rtwpvg-single-image-container img'; | |
| 76 | - $selectors['image_border_radius'] = $selectors['image_width'] . ',{{WRAPPER}} .rtsb-product-images .rtwpvg-single-image-container img'; | |
| 77 | - return $selectors; | |
| 78 | - } | |
| 79 | - | |
| 80 | - | |
| 81 | -} | |
| 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 | +} | |