PluginProbe
Enter Addons – Ultimate Template Builder for Elementor / 2.3.2
Enter Addons – Ultimate Template Builder for Elementor v2.3.2
trunk 2.2.10 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4
enteraddons / admin / inc / Admin_Menu.php

Admin_Menu.php in Enter Addons – Ultimate Template Builder for Elementor 2.3.2, at admin/inc/Admin_Menu.php

71 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Enteraddons\Admin;
3
4 /**
5 * Enteraddons admin class
6 *
7 * @package Enteraddons
8 * @author ThemeLooks
9 * @copyright 2022 ThemeLooks
10 * @license GPL-2.0-or-later
11 *
12 *
13 */
14
15 if( !class_exists('Admin_Menu') ) {
16 class Admin_Menu{
17
18 private static $instance = null;
19
20 function __construct() {
21 add_action( 'admin_menu', array( __CLASS__, 'admin_menu_page' ) );
22 add_action( 'admin_init', array( __CLASS__, 'page_settings_init' ) );
23 }
24
25 public static function getInstance() {
26 if( is_null( self::$instance ) ) {
27 self::$instance = new self();
28 }
29 return self::$instance;
30 }
31
32 public static function admin_menu_page() {
33 $is_active = get_option(ENTERADDONS_OPTION_KEY);
34 // add top level menu page
35 add_menu_page(
36 esc_html__( 'Enter Addons Settings', 'enteraddons' ),
37 esc_html__( 'Enter Addons', 'enteraddons' ),
38 'manage_options',
39 'enteraddons',
40 array( __CLASS__, 'admin_view' ),
41 ENTERADDONS_DIR_ASSETS_URL.'menu-icon.png'
42 );
43 add_submenu_page( 'enteraddons', esc_html__( 'Enter Addons', 'enteraddons' ), esc_html__( 'Enter Addons', 'enteraddons' ),'manage_options', 'enteraddons' );
44 // Check Is Header Footer Active
45 $extensions = !empty( $is_active['extensions'] ) ? $is_active['extensions'] : [];
46 if( in_array( 'header-footer' , $extensions ) ) {
47 add_submenu_page(
48 'enteraddons',
49 esc_html__( 'Header Footer Builder', 'enteraddons' ), //page title
50 esc_html__( 'Header Footer Builder', 'enteraddons' ), //menu title
51 'manage_options', //capability,
52 'edit.php?post_type=ea_builder_template',//menu slug
53 );
54 }
55 // Do action hook "After admin menu"
56 do_action('ea_after_admin_menu');
57 }
58 public static function admin_view() {
59 $view = new \Enteraddons\Admin\Admin_Templates_Map();
60 $view->admin_page_init();
61 }
62 public static function page_settings_init() {
63 register_setting(
64 'enteraddons_settings_option_group', // Option group
65 'enteraddons_options' // Option name
66 );
67 }
68
69 }
70
71 }