dashboard
1 year ago
extension
1 year ago
Assets.php
1 year ago
Dashboard.php
1 year ago
Module_Settings.php
1 year ago
Plugin_Installer.php
1 year ago
Assets.php
53 lines
| 1 | <?php |
| 2 | namespace SPEL\includes\Admin; |
| 3 | |
| 4 | // Exit if accessed directly |
| 5 | if (!defined('ABSPATH')) { |
| 6 | exit; |
| 7 | } |
| 8 | |
| 9 | /** |
| 10 | * Class Assets |
| 11 | * @package Spider Elements |
| 12 | */ |
| 13 | class Assets { |
| 14 | |
| 15 | /** |
| 16 | * Assets constructor. |
| 17 | */ |
| 18 | public function __construct() { |
| 19 | |
| 20 | // Register Admin Panel Scripts |
| 21 | add_action( 'admin_enqueue_scripts', [ $this, 'admin_scripts' ] ); |
| 22 | |
| 23 | } |
| 24 | |
| 25 | |
| 26 | /** |
| 27 | * Register Admin Panel Scripts |
| 28 | * |
| 29 | * Register custom scripts required to run Spider Elements. |
| 30 | * |
| 31 | * @access public |
| 32 | */ |
| 33 | public function admin_scripts(): void |
| 34 | { |
| 35 | |
| 36 | if ( isset( $_GET['page'] ) && $_GET['page'] === 'spider_elements_settings' ) { |
| 37 | |
| 38 | // Register Admin Panel Style's |
| 39 | wp_enqueue_style( 'spel-icomoon', SPEL_VEND . '/icomoon/style.css', [], SPEL_VERSION ); |
| 40 | wp_enqueue_style( 'spel-fancybox', SPEL_VEND . '/fancybox/fancybox.min.css', [], SPEL_VERSION ); |
| 41 | wp_enqueue_style( 'spel-admin', SPEL_CSS . '/admin.css', [], SPEL_VERSION); |
| 42 | |
| 43 | |
| 44 | // Register Admin Panel Script's |
| 45 | wp_enqueue_script( 'spel-isotope', SPEL_VEND . '/isotope/isotope.min.js', ['jquery'], '2.2.2', ['strategy' => 'defer'] ); |
| 46 | wp_enqueue_script( 'spel-imageloaded', SPEL_VEND . '/imageloaded/imageloaded.min.js', ['jquery'], '4.1.0', ['strategy' => 'defer'] ); |
| 47 | wp_enqueue_script( 'spel-fancybox', SPEL_VEND . '/fancybox/fancybox.min.js', ['jquery'], '3.5.7', ['strategy' => 'defer'] ); |
| 48 | wp_enqueue_script( 'spel-admin', SPEL_JS . '/admin.js', ['jquery'], SPEL_VERSION, ['strategy' => 'defer'] ); |
| 49 | } |
| 50 | |
| 51 | } |
| 52 | |
| 53 | } |