| @@ -305,8 +305,11 @@ | ||
| 305 | 305 | * |
| 306 | 306 | * @return void |
| 307 | 307 | */ |
| 308 | 308 | public function add_admin_menu() { |
| 309 | + require_once PHOTONIC_PATH . "/Admin/Admin_Menu.php"; | |
| 310 | + $this->admin_menu = new Admin_Menu(__FILE__, $this); | |
| 311 | + | |
| 309 | 312 | if (current_user_can('edit_theme_options')) { |
| 310 | 313 | $parent_slug = 'photonic-options-manager'; |
| 311 | 314 | } |
| 312 | 315 | elseif (current_user_can('edit_posts')) { |
| @@ -569,14 +572,8 @@ | ||
| 569 | 572 | } |
| 570 | 573 | |
| 571 | 574 | public function admin_init(): void { |
| 572 | 575 | require_once PHOTONIC_PATH . "/Admin/Admin.php"; |
| 573 | - | |
| 574 | - if (!empty($_REQUEST['page']) && // phpcs:ignore WordPress.Security.NonceVerification | |
| 575 | - in_array($_REQUEST['page'], ['photonic-options-manager', 'photonic-options', 'photonic-helpers', 'photonic-getting-started', 'photonic-auth', 'photonic-shortcode-replace'], true)) { // phpcs:ignore WordPress.Security.NonceVerification | |
| 576 | - require_once PHOTONIC_PATH . "/Admin/Admin_Menu.php"; | |
| 577 | - $this->admin_menu = new Admin_Menu(__FILE__, $this); | |
| 578 | - } | |
| 579 | 576 | } |
| 580 | 577 | |
| 581 | 578 | public function add_extensions() { |
| 582 | 579 | require_once "Gallery.php"; |