1 | <?php |
||
15 | class core { |
||
16 | |||
17 | /** |
||
18 | * Set this object type assets |
||
19 | * |
||
20 | * @since 1.0.0 |
||
21 | * @access public |
||
22 | * @var array |
||
23 | */ |
||
24 | public $assets = [ |
||
25 | 'script' => [], |
||
26 | 'style' => [], |
||
27 | ]; |
||
28 | |||
29 | /** |
||
30 | * setup actions and hooks - override to add specific hooks. use |
||
31 | * parent::actions() to keep admin head |
||
32 | * |
||
33 | * @since 1.0.0 |
||
34 | * @access protected |
||
35 | */ |
||
36 | protected function actions() { |
||
48 | |||
49 | |||
50 | /** |
||
51 | * Define core UIX styles - override to register core ( common styles for |
||
52 | * uix type ) |
||
53 | * |
||
54 | * @since 1.0.0 |
||
55 | * @access public |
||
56 | */ |
||
57 | public function set_assets() { |
||
65 | |||
66 | /** |
||
67 | * enqueue core assets |
||
68 | * |
||
69 | * @since 1.0.0 |
||
70 | * @access public |
||
71 | */ |
||
72 | public function enqueue_core() { |
||
82 | |||
83 | /** |
||
84 | * Do core enqueue actions. |
||
85 | * |
||
86 | * @since 3.0.0 |
||
87 | * @access public |
||
88 | */ |
||
89 | private function enqueue_actions() { |
||
104 | |||
105 | /** |
||
106 | * Register UIX depend js and css and call set assets |
||
107 | * |
||
108 | * @since 1.0.0 |
||
109 | * @access protected |
||
110 | */ |
||
111 | protected function core_assets() { |
||
122 | |||
123 | /** |
||
124 | * runs after assets have been enqueued |
||
125 | * |
||
126 | * @since 1.0.0 |
||
127 | * @access protected |
||
128 | */ |
||
129 | protected function set_active_styles() { |
||
131 | |||
132 | /** |
||
133 | * Sets ajax assets. |
||
134 | * |
||
135 | * @since 3.0.0 |
||
136 | * @access protected |
||
137 | */ |
||
138 | protected function set_ajax_assets() { |
||
155 | |||
156 | /** |
||
157 | * Base color helper |
||
158 | * |
||
159 | * @since 1.0.0 |
||
160 | * @access public |
||
161 | */ |
||
162 | protected function base_color() { |
||
180 | } |
||
181 | |||
182 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: