| @@ -1,54 +1,56 @@ | ||
| 1 | -<?php | |
| 2 | -namespace Booktics\Assets; | |
| 3 | - | |
| 4 | -/** | |
| 5 | - * Manage all common scripts and styles | |
| 6 | - */ | |
| 7 | -class Common_Assets extends Base_Assets { | |
| 8 | - /** | |
| 9 | - * Register single service | |
| 10 | - * | |
| 11 | - * @return void | |
| 12 | - */ | |
| 13 | - public function register() { | |
| 14 | - if ( is_admin() ) { | |
| 15 | - add_action( 'admin_enqueue_scripts', [$this, 'register_styles_scripts'] ); | |
| 16 | - add_action( 'admin_enqueue_scripts', [$this, 'enqueue'] ); | |
| 17 | - } else { | |
| 18 | - add_action( 'wp_enqueue_scripts', [$this, 'register_styles_scripts'] ); | |
| 19 | - add_action( 'wp_enqueue_scripts', [$this, 'enqueue'] ); | |
| 20 | - } | |
| 21 | - } | |
| 22 | - | |
| 23 | - /** | |
| 24 | - * Enqueue scripts and styles | |
| 25 | - * | |
| 26 | - * @return void | |
| 27 | - */ | |
| 28 | - public function enqueue() { | |
| 29 | - | |
| 30 | - } | |
| 31 | - | |
| 32 | - /** | |
| 33 | - * Get all scripts | |
| 34 | - * | |
| 35 | - * @return array List register scripts | |
| 36 | - */ | |
| 37 | - public function get_scripts(): array { | |
| 38 | - $scripts = []; | |
| 39 | - | |
| 40 | - return apply_filters( 'booktics_common_assets', $scripts ); | |
| 41 | - } | |
| 42 | - | |
| 43 | - /** | |
| 44 | - * List of register styles | |
| 45 | - * | |
| 46 | - * @return array | |
| 47 | - */ | |
| 48 | - public function get_styles(): array { | |
| 49 | - $styles = []; | |
| 50 | - | |
| 51 | - return apply_filters( 'booktics_common_styles', $styles ); | |
| 52 | - } | |
| 53 | -} | |
| 54 | - | |
| 1 | +<?php | |
| 2 | +namespace Booktics\Assets; | |
| 3 | + | |
| 4 | +if ( ! defined( 'ABSPATH' ) ) exit; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * Manage all common scripts and styles | |
| 8 | + */ | |
| 9 | +class Common_Assets extends Base_Assets { | |
| 10 | + /** | |
| 11 | + * Register single service | |
| 12 | + * | |
| 13 | + * @return void | |
| 14 | + */ | |
| 15 | + public function register() { | |
| 16 | + if ( is_admin() ) { | |
| 17 | + add_action( 'admin_enqueue_scripts', [$this, 'register_styles_scripts'] ); | |
| 18 | + add_action( 'admin_enqueue_scripts', [$this, 'enqueue'] ); | |
| 19 | + } else { | |
| 20 | + add_action( 'wp_enqueue_scripts', [$this, 'register_styles_scripts'] ); | |
| 21 | + add_action( 'wp_enqueue_scripts', [$this, 'enqueue'] ); | |
| 22 | + } | |
| 23 | + } | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * Enqueue scripts and styles | |
| 27 | + * | |
| 28 | + * @return void | |
| 29 | + */ | |
| 30 | + public function enqueue() { | |
| 31 | + | |
| 32 | + } | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * Get all scripts | |
| 36 | + * | |
| 37 | + * @return array List register scripts | |
| 38 | + */ | |
| 39 | + public function get_scripts(): array { | |
| 40 | + $scripts = []; | |
| 41 | + | |
| 42 | + return apply_filters( 'booktics_common_assets', $scripts ); | |
| 43 | + } | |
| 44 | + | |
| 45 | + /** | |
| 46 | + * List of register styles | |
| 47 | + * | |
| 48 | + * @return array | |
| 49 | + */ | |
| 50 | + public function get_styles(): array { | |
| 51 | + $styles = []; | |
| 52 | + | |
| 53 | + return apply_filters( 'booktics_common_styles', $styles ); | |
| 54 | + } | |
| 55 | +} | |
| 56 | + | |