| 1 |
<?php |
| 2 |
/** |
| 3 |
* Main StorefrontSupport class Only Work for storefront theme. |
| 4 |
* |
| 5 |
* @package RadiusTheme\SB |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace RadiusTheme\SB\Controllers\ThemesSupport\Woodmart; |
| 9 |
|
| 10 |
use RadiusTheme\SB\Helpers\BuilderFns; |
| 11 |
use RadiusTheme\SB\Traits\SingletonTrait; |
| 12 |
|
| 13 |
// Do not allow directly accessing this file. |
| 14 |
if ( ! defined( 'ABSPATH' ) ) { |
| 15 |
exit( 'This script cannot be accessed directly.' ); |
| 16 |
} |
| 17 |
|
| 18 |
/** |
| 19 |
* Product Description class |
| 20 |
*/ |
| 21 |
class ThemeSupport { |
| 22 |
/** |
| 23 |
* Singleton |
| 24 |
*/ |
| 25 |
use SingletonTrait; |
| 26 |
|
| 27 |
/** |
| 28 |
* Construct function |
| 29 |
*/ |
| 30 |
private function __construct() { |
| 31 |
add_action( 'wp_enqueue_scripts', [ $this, 'woodmart_enqueue_base_styles' ] ); |
| 32 |
} |
| 33 |
/** |
| 34 |
* Get class instance. |
| 35 |
* |
| 36 |
* @return object Instance. |
| 37 |
*/ |
| 38 |
public static function init() { |
| 39 |
if ( ! self::$instance ) { |
| 40 |
self::$instance = new self(); |
| 41 |
} |
| 42 |
return self::$instance; |
| 43 |
} |
| 44 |
|
| 45 |
/** |
| 46 |
* @return void |
| 47 |
*/ |
| 48 |
public static function woodmart_enqueue_base_styles() { |
| 49 |
if( ! BuilderFns::is_product() ){ |
| 50 |
return; |
| 51 |
} |
| 52 |
$version = woodmart_get_theme_info( 'Version' ); |
| 53 |
$minified = woodmart_get_opt( 'minified_css' ) ? '.min' : ''; |
| 54 |
$is_rtl = is_rtl() ? '-rtl' : ''; |
| 55 |
$style_url = WOODMART_STYLES . '/style' . $is_rtl . '-elementor' . $minified . '.css'; |
| 56 |
wp_enqueue_style( 'woodmart-style', $style_url, array( 'bootstrap' ), $version ); |
| 57 |
|
| 58 |
} |
| 59 |
|
| 60 |
|
| 61 |
} |
| 62 |
|