PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.5.2
ShopBuilder – WooCommerce Builder For Elementor v2.5.2
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
← All changes | app/Controllers/Admin/AdminInit.php +29 -16 2.0.32.5.2 View file →
@@ -4,10 +4,12 @@
4 4
5 5 defined( 'ABSPATH' ) || exit();
6 6
7 7 use RadiusTheme\SB\Controllers\Admin\Ajax as Ajax;
8 +use RadiusTheme\SB\Helpers\Fns;
8 9 use RadiusTheme\SB\Traits\SingletonTrait;
9 10
11 +
10 12 class AdminInit {
11 13 /**
12 14 * Parent Menu Page Slug
13 15 */
@@ -24,9 +26,9 @@
24 26 * @var string
25 27 */
26 28 static $parent_menu_hook = '';
27 29
28 - //private $menu_link_part;
30 + // private $menu_link_part;
29 31
30 32 use SingletonTrait;
31 33
32 34 public function __construct() {
@@ -55,9 +57,10 @@
55 57 * @return void
56 58 */
57 59 public function upgrade() {
58 60 Notice\Upgrade::instance();
59 - Notice\BlackFriday::instance();
61 + Notice\BFDiscount::instance();
62 + Notice\Review::instance();
60 63 }
61 64
62 65 public function init() {
63 66 add_action( 'admin_menu', [ $this, 'add_menu' ], 25 );
@@ -82,11 +85,8 @@
82 85 self::MENU_CAPABILITY,
83 86 'rtsb-settings',
84 87 [ $this, 'settings_page' ],
85 88 );
86 -
87 - do_action( 'rtsb/add/more/submenu', self::MENU_PAGE_SLUG, self::MENU_CAPABILITY );
88 - /*
89 89 add_submenu_page(
90 90 self::MENU_PAGE_SLUG,
91 91 esc_html__( 'Get Help', 'shopbuilder' ),
92 92 esc_html__( 'Get Help', 'shopbuilder' ),
@@ -93,9 +93,18 @@
93 93 self::MENU_CAPABILITY,
94 94 'rtsb-get-help',
95 95 [ $this, 'get_help_page' ],
96 96 );
97 - */
97 + add_submenu_page(
98 + self::MENU_PAGE_SLUG,
99 + esc_html__( 'Themes & Apps', 'shopbuilder' ),
100 + esc_html__( 'Themes & Apps', 'shopbuilder' ),
101 + self::MENU_CAPABILITY,
102 + 'rtsb-themes',
103 + [ $this, 'get_themes_page' ],
104 + );
105 + do_action( 'rtsb/add/more/submenu', self::MENU_PAGE_SLUG, self::MENU_CAPABILITY );
106 +
98 107 // Remove Parent Submenu
99 108 remove_submenu_page( self::MENU_PAGE_SLUG, self::MENU_PAGE_SLUG );
100 109 }
101 110
@@ -105,22 +114,22 @@
105 114
106 115
107 116 public function settings_page() {
108 117 ?>
109 - <div class="wrap rtsb-admin-wrap">
110 - <div id="rtsb-admin-app"></div>
111 - </div>
118 + <div class="wrap rtsb-admin-wrap">
119 + <div id="rtsb-admin-app"></div>
120 + </div>
112 121 <?php
113 122 }
114 123
115 124 public function get_help_page() {
116 - ?>
117 - <div class="wrap rtsb-get-help-wrap">
118 - Get Help
119 - </div>
120 - <?php
125 + Fns::renderView( 'help' );
121 126 }
122 127
128 + public function get_themes_page() {
129 + Fns::renderView( 'themes' );
130 + }
131 +
123 132 /**
124 133 * Remove admin notices
125 134 */
126 135 public function remove_all_notices() {
@@ -127,9 +136,14 @@
127 136 add_action(
128 137 'in_admin_header',
129 138 function () {
130 139 $screen = get_current_screen();
131 - if ( in_array( $screen->base, [ 'shopbuilder_page_rtsb-settings', 'shopbuilder_page_rtsb-license' ]) ) {
140 +
141 + if ( in_array(
142 + $screen->base,
143 + [ 'shopbuilder_page_rtsb-settings', 'shopbuilder_page_rtsb-license', 'shopbuilder_page_rtsb-themes' ],
144 + true
145 + ) ) {
132 146 remove_all_actions( 'admin_notices' );
133 147 remove_all_actions( 'all_admin_notices' );
134 148 }
135 149 },
@@ -135,6 +149,5 @@
135 149 },
136 150 1000
137 151 );
138 152 }
139 -
140 153 }