| @@ -32,8 +32,10 @@ | ||
| 32 | 32 | public function __construct() { |
| 33 | 33 | // Includes. |
| 34 | 34 | $this->includes(); |
| 35 | 35 | |
| 36 | + add_action( 'plugins_loaded', array( $this, 'maybe_define_awl_constant' ), 5 ); | |
| 37 | + | |
| 36 | 38 | // Register scripts. |
| 37 | 39 | add_action( 'wp_enqueue_scripts', array( $this, 'register_global_js_and_css' ) ); |
| 38 | 40 | |
| 39 | 41 | // Enqueue scripts. |
| @@ -156,8 +158,23 @@ | ||
| 156 | 158 | * |
| 157 | 159 | * @since 1.0 |
| 158 | 160 | */ |
| 159 | 161 | do_action( 'merchant_admin_after_include_modules_classes' ); |
| 162 | + } | |
| 163 | + | |
| 164 | + /** | |
| 165 | + * Define MERCHANT_AWL_ACTIVE when White Label is applied. | |
| 166 | + * | |
| 167 | + * @return void | |
| 168 | + */ | |
| 169 | + public function maybe_define_awl_constant() { | |
| 170 | + if ( defined( 'MERCHANT_AWL_ACTIVE' ) ) { | |
| 171 | + return; | |
| 172 | + } | |
| 173 | + | |
| 174 | + if ( merchant_white_label_is_applied() ) { | |
| 175 | + define( 'MERCHANT_AWL_ACTIVE', true ); | |
| 176 | + } | |
| 160 | 177 | } |
| 161 | 178 | |
| 162 | 179 | /** |
| 163 | 180 | * Add to body class. |