1 | <?php |
||
15 | class core { |
||
16 | |||
17 | /** |
||
18 | * List of core object scripts ( common scripts ) |
||
19 | * |
||
20 | * @since 1.0.0 |
||
21 | * @access protected |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $scripts = []; |
||
25 | |||
26 | /** |
||
27 | * List of core object styles ( common styles ) |
||
28 | * |
||
29 | * @since 1.0.0 |
||
30 | * @access protected |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $styles = []; |
||
34 | |||
35 | |||
36 | /** |
||
37 | * setup actions and hooks - override to add specific hooks. use |
||
38 | * parent::actions() to keep admin head |
||
39 | * |
||
40 | * @since 1.0.0 |
||
41 | * @access protected |
||
42 | */ |
||
43 | protected function actions() { |
||
55 | |||
56 | |||
57 | /** |
||
58 | * Define core UIX styles - override to register core ( common styles for |
||
59 | * uix type ) |
||
60 | * |
||
61 | * @since 1.0.0 |
||
62 | * @access public |
||
63 | */ |
||
64 | public function set_assets() { |
||
72 | |||
73 | /** |
||
74 | * enqueue core assets |
||
75 | * |
||
76 | * @since 1.0.0 |
||
77 | * @access public |
||
78 | */ |
||
79 | public function enqueue_core() { |
||
89 | |||
90 | /** |
||
91 | * Do core enqueue actions. |
||
92 | * |
||
93 | * @since 3.0.0 |
||
94 | * @access public |
||
95 | */ |
||
96 | private function enqueue_actions() { |
||
111 | |||
112 | /** |
||
113 | * Register UIX depend js and css and call set assets |
||
114 | * |
||
115 | * @since 1.0.0 |
||
116 | * @access protected |
||
117 | */ |
||
118 | protected function core_assets() { |
||
129 | |||
130 | /** |
||
131 | * runs after assets have been enqueued |
||
132 | * |
||
133 | * @since 1.0.0 |
||
134 | * @access protected |
||
135 | */ |
||
136 | protected function set_active_styles() { |
||
138 | |||
139 | /** |
||
140 | * Base color helper |
||
141 | * |
||
142 | * @since 1.0.0 |
||
143 | * @access public |
||
144 | */ |
||
145 | protected function base_color() { |
||
163 | } |
||
164 | |||
165 |
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: