| 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,{{WRAPPER}} .rtwpvg-wrapper .rtwpvg-slider-wrapper'; |
| 77 |
return $selectors; |
| 78 |
} |
| 79 |
|
| 80 |
|
| 81 |
} |
| 82 |
|