1 | <?php |
||
25 | final class Admin { |
||
26 | |||
27 | /** |
||
28 | * The single instance of the class |
||
29 | * |
||
30 | * @var object |
||
31 | * @since 2.0.0 |
||
32 | */ |
||
33 | protected static $_instance = null; |
||
34 | |||
35 | /** |
||
36 | * Array containing the plugin links |
||
37 | * |
||
38 | * @var array |
||
39 | * @since 2.0.0 |
||
40 | */ |
||
41 | protected $links; |
||
42 | |||
43 | /** |
||
44 | * Return the single class instance |
||
45 | * |
||
46 | * @return object |
||
47 | * @since 2.0.0 |
||
48 | */ |
||
49 | public static function instance() { |
||
55 | |||
56 | /** |
||
57 | * Class constructor |
||
58 | * |
||
59 | * @uses add_action() |
||
60 | * @uses add_filter() |
||
61 | * @uses get_option() |
||
62 | * @uses get_bloginfo() |
||
63 | * |
||
64 | * @since 2.0.0 |
||
65 | */ |
||
66 | protected function __construct() { |
||
72 | |||
73 | /** |
||
74 | * Prevent the class from being cloned |
||
75 | * |
||
76 | * @return void |
||
77 | * @since 2.0.0 |
||
78 | */ |
||
79 | protected function __clone() { |
||
82 | |||
83 | /** |
||
84 | * Load language files |
||
85 | * |
||
86 | * @uses load_plugin_textdomain() |
||
87 | * |
||
88 | * @return void |
||
89 | * @since 2.0.0 |
||
90 | */ |
||
91 | public function load_textdomain() { |
||
94 | |||
95 | /** |
||
96 | * Checks if the plugin admin code should be loaded |
||
97 | * |
||
98 | * @uses apply_filters() |
||
99 | * |
||
100 | * @global string $pagenow |
||
101 | * @return boolean |
||
102 | * @since 2.0.0 |
||
103 | */ |
||
104 | public function enabled() { |
||
109 | |||
110 | /** |
||
111 | * Add actions and filters (only in widgets admin page) |
||
112 | * |
||
113 | * @uses add_action() |
||
114 | * @uses add_filter() |
||
115 | * @uses do_action() |
||
116 | * |
||
117 | * @return void |
||
118 | * @since 2.0.0 |
||
119 | */ |
||
120 | public function admin_init() { |
||
134 | |||
135 | /** |
||
136 | * Output the visual editor |
||
137 | * |
||
138 | * @uses wp_editor() |
||
139 | * |
||
140 | * @param string $text Text inside the editor. |
||
141 | * @param string $editor_id Editor instance ID. |
||
142 | * @param string $name Editor instance name. |
||
143 | * @param string $type Editor instance type. |
||
144 | * @return void |
||
145 | * @since 2.0.0 |
||
146 | */ |
||
147 | public function editor( $text, $editor_id, $name = '', $type = 'visual' ) { |
||
153 | |||
154 | /** |
||
155 | * Remove editor content filters for multiple editor instances |
||
156 | * Workaround for WordPress Core bug #28403 https://core.trac.wordpress.org/ticket/28403 |
||
157 | * |
||
158 | * @uses remove_filter |
||
159 | * |
||
160 | * @return void |
||
161 | * @since 2.1.7 |
||
162 | */ |
||
163 | public function fix_the_editor_content_filter() { |
||
167 | |||
168 | /** |
||
169 | * Initialize plugin links |
||
170 | * |
||
171 | * @return void |
||
172 | * @since 2.0.0 |
||
173 | */ |
||
174 | public function init_links() { |
||
190 | |||
191 | /** |
||
192 | * Display plugin links |
||
193 | * |
||
194 | * @return void |
||
195 | * @since 2.0.0 |
||
196 | */ |
||
197 | public function display_links() { |
||
210 | |||
211 | /** |
||
212 | * Show row meta on the plugin screen |
||
213 | * |
||
214 | * @uses esc_html() |
||
215 | * @uses esc_url() |
||
216 | * |
||
217 | * @param string[] $links Array of links. |
||
218 | * @param string $file Plugin's filename. |
||
219 | * @return string[] |
||
220 | * @since 2.0.0 |
||
221 | */ |
||
222 | public function plugin_row_meta( $links, $file ) { |
||
230 | |||
231 | /** |
||
232 | * Show admin notice when visual editor is disabled in current user's profile settings |
||
233 | * |
||
234 | * @uses get_user_meta() |
||
235 | * @uses get_current_user_id() |
||
236 | * |
||
237 | * @return void |
||
238 | * @since 2.4.0 |
||
239 | */ |
||
240 | public function visual_editor_disabled_notice() { |
||
253 | |||
254 | /** |
||
255 | * Store dismission of the "Visual Editor disabled" notice for the current user |
||
256 | * |
||
257 | * @uses add_user_meta() |
||
258 | * @uses get_current_user_id() |
||
259 | * |
||
260 | * @return void |
||
261 | * @since 2.4.0 |
||
262 | */ |
||
263 | public function visual_editor_disabled_dismiss_notice() { |
||
268 | |||
269 | /** |
||
270 | * Register a private custom post type to be used for link embed previews |
||
271 | * |
||
272 | * @uses register_post_type() |
||
273 | * |
||
274 | * @return void |
||
275 | * @since 3.0.0 |
||
276 | */ |
||
277 | public function register_dummy_post_type() { |
||
292 | |||
293 | /** |
||
294 | * Get dummy post ID for link embed previews |
||
295 | * |
||
296 | * @uses WP_Query() |
||
297 | * @uses wp_insert_post() |
||
298 | * @uses update_option() |
||
299 | * @uses get_option() |
||
300 | * |
||
301 | * @return int |
||
302 | * @since 3.0.0 |
||
303 | */ |
||
304 | public function get_dummy_post_id() { |
||
313 | |||
314 | } // END class |
||
315 | |||
317 |