| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; // Exit if accessed directly |
| 4 |
} |
| 5 |
|
| 6 |
/** |
| 7 |
* Avada theme compatibility layer |
| 8 |
*/ |
| 9 |
if ( ! class_exists( 'Merchant_Avada_Theme' ) ) { |
| 10 |
class Merchant_Avada_Theme { |
| 11 |
|
| 12 |
/** |
| 13 |
* Constructor. |
| 14 |
*/ |
| 15 |
public function __construct() { |
| 16 |
add_action( 'wp_enqueue_scripts', array( $this, 'styles' ) ); |
| 17 |
} |
| 18 |
|
| 19 |
/** |
| 20 |
* Load compatibility styles if the Avada theme is installed and active. |
| 21 |
* |
| 22 |
* @return void |
| 23 |
*/ |
| 24 |
public function styles() { |
| 25 |
if ( ! merchant_is_avada_active() ) { |
| 26 |
return; |
| 27 |
} |
| 28 |
|
| 29 |
wp_enqueue_style( |
| 30 |
'merchant-avada-compatibility', |
| 31 |
MERCHANT_URI . 'assets/css/compatibility/avada/style.min.css', |
| 32 |
array(), |
| 33 |
MERCHANT_VERSION |
| 34 |
); |
| 35 |
} |
| 36 |
} |
| 37 |
|
| 38 |
/** |
| 39 |
* The class object can be accessed with "global $avada_compatibility", to allow removing actions. |
| 40 |
* Improving Third-party integrations. |
| 41 |
*/ |
| 42 |
$merchant_avada_compatibility = new Merchant_Avada_Theme(); |
| 43 |
} |
| 44 |
|