| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; // Exit if accessed directly! |
| 4 |
} |
| 5 |
|
| 6 |
if ( ! class_exists( 'WPSC_Ai_Frontend' ) ) : |
| 7 |
|
| 8 |
final class WPSC_Ai_Frontend { |
| 9 |
|
| 10 |
/** |
| 11 |
* Initialize this class |
| 12 |
* |
| 13 |
* @return void |
| 14 |
*/ |
| 15 |
public static function init() { |
| 16 |
|
| 17 |
// load scripts & styles. |
| 18 |
add_action( 'wpsc_js_frontend', array( __CLASS__, 'frontend_scripts' ) ); |
| 19 |
add_action( 'wpsc_css_frontend', array( __CLASS__, 'frontend_styles' ) ); |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* Frontend scripts |
| 24 |
* |
| 25 |
* @return void |
| 26 |
*/ |
| 27 |
public static function frontend_scripts() { |
| 28 |
|
| 29 |
echo file_get_contents( WPSC_ABSPATH . 'asset/js/ai-assistant/script.js' ) . PHP_EOL . PHP_EOL; // phpcs:ignore |
| 30 |
} |
| 31 |
|
| 32 |
/** |
| 33 |
* Frontend styles |
| 34 |
* |
| 35 |
* @return void |
| 36 |
*/ |
| 37 |
public static function frontend_styles() { |
| 38 |
|
| 39 |
if ( is_rtl() ) { |
| 40 |
echo file_get_contents( WPSC_ABSPATH . 'asset/css/ai-assistant/public-rtl.css' ) . PHP_EOL . PHP_EOL; // phpcs:ignore |
| 41 |
} else { |
| 42 |
echo file_get_contents( WPSC_ABSPATH . 'asset/css/ai-assistant/public.css' ) . PHP_EOL . PHP_EOL; // phpcs:ignore |
| 43 |
} |
| 44 |
} |
| 45 |
} |
| 46 |
endif; |
| 47 |
WPSC_Ai_Frontend::init(); |
| 48 |
|