forked from themeum/kirki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclass-kirki-scripts-registry.php
72 lines (62 loc) · 1.4 KB
/
class-kirki-scripts-registry.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/**
* Instantiates all other needed scripts.
*
* @package Kirki
* @category Core
* @author Aristeides Stathopoulos
* @copyright Copyright (c) 2016, Aristeides Stathopoulos
* @license http://opensource.org/licenses/https://opensource.org/licenses/MIT
* @since 1.0
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Kirki_Scripts_Registry' ) ) {
/**
* Instantiates dependent classes
*/
class Kirki_Scripts_Registry {
/**
* Dependencies
*
* @access public
* @var object Kirki_Enqueue.
*/
public $dependencies;
/**
* Tooltips
*
* @access public
* @var object Kirki_Scripts_Tooltips.
*/
public $tooltips;
/**
* Icons
*
* @access public
* @var object Kirki_Scripts_Icons.
*/
public $icons;
/**
* The main class constructor.
* Instantiates secondary classes.
*/
public function __construct() {
$this->dependencies = new Kirki_Enqueue();
$this->tooltips = new Kirki_Scripts_Tooltips();
$this->icons = new Kirki_Scripts_Icons();
}
/**
* Prepares a script for echoing.
* Wraps it in <script> and jQuery.
*
* @param string $script The contents of the script.
* @return string
*/
public static function prepare( $script ) {
return '<script>jQuery(document).ready(function($) { "use strict"; ' . $script . '});</script>';
}
}
}