PluginProbe
StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates & More / 2.2.0
StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates & More v2.2.0
2.3.0 2.2.0 2.1.1 2.1.0 2.0.0 1.10.0 1.9.1 1.9.0 1.2.1 1.2.2 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6.0 All 59 releases
storeengine / includes / ajax / dashboard.php

dashboard.php in StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates & More 2.2.0, at includes/ajax/dashboard.php

28 lines 603 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace StoreEngine\Ajax;
3
4 use StoreEngine\Admin\Menu;
5 use StoreEngine\Classes\AbstractAjaxHandler;
6 use StoreEngine\Utils\Helper;
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit();
10 }
11
12 class Dashboard extends AbstractAjaxHandler {
13 public function __construct() {
14 $this->actions = [
15 'get_admin_menu_items' => [
16 'capability' => 'manage_options',
17 'callback' => [ $this, 'get_admin_menu_items' ],
18 ],
19 ];
20 }
21
22 protected function get_admin_menu_items() {
23 // @FIXME json-encoding 2 times.
24 $menu_items = wp_json_encode( Menu::get_menu_tree() );
25 wp_send_json_success( $menu_items );
26 }
27 }
28