page_title = __( 'Eventin', 'eventin' ); $this->menu_title = __( 'Eventin', 'eventin' ); $this->base_capability = 'read'; $this->capability = 'manage_options'; $this->menu_slug = 'eventin'; $this->icon = $this->get_eventin_menu_icon(); $this->position = 10; $this->submenus = [ [ 'title' => __( 'Dashboard', 'eventin' ), 'capability' => 'etn_manage_dashboard', 'url' => 'admin.php?page=' . $this->menu_slug . '#/dashboard', 'position' => 1, ],[ 'title' => __( 'Events', 'eventin' ), 'capability' => 'etn_manage_event', 'url' => 'admin.php?page=' . $this->menu_slug . '#/events', 'position' => 2, ], [ 'title' => __( 'Organizers', 'eventin' ), 'capability' => 'etn_manage_organizer', 'url' => 'admin.php?page=' . $this->menu_slug . '#/speakers', 'position' => 3, ], [ 'title' => __( 'Schedules', 'eventin' ), 'capability' => 'etn_manage_schedule', 'url' => 'admin.php?page=' . $this->menu_slug . '#/schedules', 'position' => 4, ], [ 'title' => __( 'Bookings', 'eventin' ), 'capability' => 'etn_manage_order', 'url' => 'admin.php?page=' . $this->menu_slug . '#/purchase-report', 'position' => 5, ], [ 'title' => __( 'Settings', 'eventin' ), 'capability' => 'etn_manage_setting', 'url' => 'admin.php?page=' . $this->menu_slug . '#/settings', 'position' => 7, ], [ 'title' => __( 'Template Builder', 'eventin' ), 'capability' => 'etn_manage_template', 'url' => 'admin.php?page=' . $this->menu_slug . '#/template-builder', 'position' => 8, ], [ 'title' => __( 'Shortcodes', 'eventin' ), 'capability' => 'etn_manage_shortcode', 'url' => 'admin.php?page=' . $this->menu_slug . '#/shortcodes', 'position' => 9, ], [ 'title' => __( 'Add-ons', 'eventin' ), 'capability' => 'etn_manage_addons', 'url' => 'admin.php?page=' . $this->menu_slug . '#/add-ons', 'position' => 10, ], [ 'title' => __( 'Our Plugins', 'eventin' ), 'capability' => 'etn_manage_our_plugins', 'url' => 'admin.php?page=' . $this->menu_slug . '#/our-plugins', 'position' => 99999, ], [ 'title' => __( 'Get Help', 'eventin' ), 'capability' => 'etn_manage_get_help', 'url' => 'admin.php?page=' . $this->menu_slug . '#/get-help', 'position' => 999999, ], ]; $is_attendee_registation = etn_get_option( 'attendee_registration' ); if ( 'on' === $is_attendee_registation ) { $this->submenus[] = [ 'title' => __( 'Attendees', 'eventin' ), 'capability' => 'etn_manage_attendee', 'url' => 'admin.php?page=' . $this->menu_slug . '#/attendees', 'position' => 6, ]; } if ( ! class_exists( 'Wpeventin_Pro' ) ) { $this->submenus[] = [ 'title' => __( 'Go Pro', 'eventin' ), 'capability' => 'etn_manage_go_pro', 'url' => 'https://themewinter.com/eventin/pricing/?utm_source=eventin+pricing&utm_medium=eventin+pro&utm_campaign=eventin', 'position' => 9999999, ]; } } /** * Register service * * @return void */ public function register_hooks(): void { add_action( 'admin_menu', [$this, 'register_menu'] ); add_action( 'admin_head', [ $this, 'highlight_submenu' ] ); add_action( 'admin_menu', [$this, 'registe_depecrated_menu'], 99 ); } /** * Register menu * * @return void */ public function register_menu() { global $submenu; add_menu_page( $this->page_title, $this->menu_title, $this->base_capability, $this->menu_slug, [$this, 'render_menu_page'], $this->icon, $this->position, ); $this->submenus = apply_filters( 'eventin_menu', $this->submenus, $this->menu_slug ); usort( $this->submenus, function($a, $b) { return $a['position'] <=> $b['position']; } ); foreach ( $this->submenus as $item ) { $submenu[ $this->menu_slug ][] = [ $item['title'], $item['capability'], $item['url'] ]; // phpcs:ignore } } /** * Render menu page * * @return void */ public function render_menu_page() { ?>
add_wizard_menu(); } /** * Add wizard submenu */ public function add_wizard_menu() { add_submenu_page( '', esc_html__( 'Wizard', 'eventin' ), esc_html__( 'Wizard', 'eventin' ), 'manage_options', 'etn-wizard', [ $this, 'etn_wizard_page' ], 11 ); } /** * Settings Markup Page * * @return void */ public function etn_wizard_page() { ?>