lightspeeddevelopment /
lsx
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * LSX Yoast Class |
||
| 4 | * |
||
| 5 | * @package lsx |
||
| 6 | * @subpackage yoast |
||
| 7 | */ |
||
| 8 | |||
| 9 | if ( ! defined( 'ABSPATH' ) ) { |
||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 10 | exit; |
||
| 11 | } |
||
| 12 | |||
| 13 | if ( ! class_exists( 'LSX_Yoast' ) ) : |
||
|
0 ignored issues
–
show
|
|||
| 14 | |||
| 15 | /** |
||
| 16 | * The LSX Yoast integration class |
||
| 17 | */ |
||
| 18 | class LSX_Yoast { |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Holds class instance |
||
| 22 | * |
||
| 23 | * @since 1.0.0 |
||
| 24 | * @var object |
||
| 25 | */ |
||
| 26 | protected static $instance = null; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Setup class. |
||
| 30 | * |
||
| 31 | * @since 1.0 |
||
| 32 | */ |
||
| 33 | public function __construct() { |
||
|
0 ignored issues
–
show
|
|||
| 34 | |||
| 35 | add_action( 'wp_enqueue_scripts', array( $this, 'lsx_yoast_scripts_add_styles' ) ); |
||
| 36 | } |
||
|
0 ignored issues
–
show
|
|||
| 37 | |||
| 38 | /** |
||
| 39 | * Return an instance of this class. |
||
| 40 | * |
||
| 41 | * @since 1.0.0 |
||
| 42 | * @return object A single instance of this class. |
||
| 43 | */ |
||
| 44 | public static function get_instance() { |
||
| 45 | // If the single instance hasn't been set, set it now. |
||
| 46 | if ( null === self::$instance ) { |
||
|
0 ignored issues
–
show
|
|||
| 47 | self::$instance = new self(); |
||
| 48 | } |
||
|
0 ignored issues
–
show
|
|||
| 49 | return self::$instance; |
||
| 50 | } |
||
|
0 ignored issues
–
show
|
|||
| 51 | |||
| 52 | /** |
||
| 53 | * Yoast enqueue styles. |
||
| 54 | * |
||
| 55 | * @package lsx |
||
| 56 | * @subpackage yoast |
||
| 57 | */ |
||
| 58 | public function lsx_yoast_scripts_add_styles() { |
||
| 59 | wp_enqueue_script( 'lsx_yoast_js', get_template_directory_uri() . '/assets/js/yoast/yoast.js', array( 'jquery' ), LSX_VERSION, true ); |
||
| 60 | wp_enqueue_style( 'lsx_yoast_css', get_template_directory_uri() . '/assets/css/yoast/yoast.css', array( 'lsx_main' ), LSX_VERSION ); |
||
| 61 | } |
||
|
0 ignored issues
–
show
|
|||
| 62 | } |
||
| 63 | |||
| 64 | endif; |
||
| 65 | |||
| 66 | LSX_Yoast::get_instance(); |
||
| 67 |