PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.4.2
ShopBuilder – WooCommerce Builder For Elementor v2.4.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 -15 2.0.12.4.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,8 +57,10 @@
55 57 * @return void
56 58 */
57 59 public function upgrade() {
58 60 Notice\Upgrade::instance();
61 + Notice\Review::instance();
62 + Notice\BFDiscount::instance();
59 63 }
60 64
61 65 public function init() {
62 66 add_action( 'admin_menu', [ $this, 'add_menu' ], 25 );
@@ -81,11 +85,8 @@
81 85 self::MENU_CAPABILITY,
82 86 'rtsb-settings',
83 87 [ $this, 'settings_page' ],
84 88 );
85 -
86 - do_action( 'rtsb/add/more/submenu', self::MENU_PAGE_SLUG, self::MENU_CAPABILITY );
87 - /*
88 89 add_submenu_page(
89 90 self::MENU_PAGE_SLUG,
90 91 esc_html__( 'Get Help', 'shopbuilder' ),
91 92 esc_html__( 'Get Help', 'shopbuilder' ),
@@ -92,9 +93,18 @@
92 93 self::MENU_CAPABILITY,
93 94 'rtsb-get-help',
94 95 [ $this, 'get_help_page' ],
95 96 );
96 - */
97 + add_submenu_page(
98 + self::MENU_PAGE_SLUG,
99 + esc_html__( 'Themes', 'shopbuilder' ),
100 + esc_html__( 'Themes', '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 +
97 107 // Remove Parent Submenu
98 108 remove_submenu_page( self::MENU_PAGE_SLUG, self::MENU_PAGE_SLUG );
99 109 }
100 110
@@ -104,22 +114,22 @@
104 114
105 115
106 116 public function settings_page() {
107 117 ?>
108 - <div class="wrap rtsb-admin-wrap">
109 - <div id="rtsb-admin-app"></div>
110 - </div>
118 + <div class="wrap rtsb-admin-wrap">
119 + <div id="rtsb-admin-app"></div>
120 + </div>
111 121 <?php
112 122 }
113 123
114 124 public function get_help_page() {
115 - ?>
116 - <div class="wrap rtsb-get-help-wrap">
117 - Get Help
118 - </div>
119 - <?php
125 + Fns::renderView( 'help' );
120 126 }
121 127
128 + public function get_themes_page() {
129 + Fns::renderView( 'themes' );
130 + }
131 +
122 132 /**
123 133 * Remove admin notices
124 134 */
125 135 public function remove_all_notices() {
@@ -126,9 +136,14 @@
126 136 add_action(
127 137 'in_admin_header',
128 138 function () {
129 139 $screen = get_current_screen();
130 - 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 + ) ) {
131 146 remove_all_actions( 'admin_notices' );
132 147 remove_all_actions( 'all_admin_notices' );
133 148 }
134 149 },
@@ -134,6 +149,5 @@
134 149 },
135 150 1000
136 151 );
137 152 }
138 -
139 153 }