1 | <?php |
||
30 | final class Admin_Pointer { |
||
31 | |||
32 | /** |
||
33 | * The single instance of the class |
||
34 | * |
||
35 | * @var object |
||
36 | * @since 2.1.0 |
||
37 | */ |
||
38 | protected static $_instance = null; |
||
39 | |||
40 | /** |
||
41 | * Return the single class instance |
||
42 | * |
||
43 | * @return object |
||
44 | * @since 2.1.0 |
||
45 | */ |
||
46 | public static function instance() { |
||
52 | |||
53 | /** |
||
54 | * Class constructor |
||
55 | * |
||
56 | * @uses add_action() |
||
57 | * |
||
58 | * @global object $wp_embed |
||
59 | * @since 2.0.0 |
||
60 | */ |
||
61 | protected function __construct() { |
||
65 | |||
66 | /** |
||
67 | * Prevent the class from being cloned |
||
68 | * |
||
69 | * @return void |
||
70 | * @since 2.1.0 |
||
71 | */ |
||
72 | protected function __clone() { |
||
75 | |||
76 | /** |
||
77 | * Add actions and filters (only in widgets admin page) |
||
78 | * |
||
79 | * @uses add_action() |
||
80 | * @uses add_filter() |
||
81 | * |
||
82 | * @return void |
||
83 | * @since 2.1.0 |
||
84 | */ |
||
85 | public function admin_init() { |
||
93 | |||
94 | /** |
||
95 | * Helper function to enqueue script |
||
96 | * |
||
97 | * @uses wp_enqueue_style() |
||
98 | * @uses wp_enqueue_script() |
||
99 | * @uses plugins_url() |
||
100 | * @uses wp_localize_script() |
||
101 | * @uses SCRIPT_DEBUG |
||
102 | * |
||
103 | * @param mixed[] $pointers Array of pointers. |
||
104 | * @return void |
||
105 | * @since 2.1.0 |
||
106 | */ |
||
107 | public function enqueue( $pointers ) { |
||
120 | |||
121 | /** |
||
122 | * Load admin pointer(s) |
||
123 | * |
||
124 | * @uses get_current_screen() |
||
125 | * @uses apply_filters() |
||
126 | * |
||
127 | * @return void |
||
128 | * @since 2.1.0 |
||
129 | */ |
||
130 | public function load() { |
||
137 | |||
138 | /** |
||
139 | * Remove dismissed pointer(s) |
||
140 | * |
||
141 | * @uses get_user_meta() |
||
142 | * @uses get_current_user_id() |
||
143 | * |
||
144 | * @param mixed[] $pointers Array of pointers. |
||
145 | * @return mixed[] |
||
146 | * @since 2.1.0 |
||
147 | */ |
||
148 | public function filter_dismissed( $pointers ) { |
||
161 | |||
162 | /** |
||
163 | * Register admin pointer(s) |
||
164 | * |
||
165 | * @param mixed[] $pointers Array of pointers. |
||
166 | * @return mixed[] |
||
167 | * @since 2.1.0 |
||
168 | */ |
||
169 | public function register( $pointers ) { |
||
187 | |||
188 | } // END class |
||
189 | |||
191 |