PluginProbe ʕ •ᴥ•ʔ
Rich Showcase for Google Reviews / 6.4
Rich Showcase for Google Reviews v6.4
6.9.8 6.9.7 6.9.6 trunk 1.4 1.42 1.43 1.44 1.45 1.46 1.47 1.48 1.49 1.5 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.7 1.6.8 1.6.9 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9 1.9.1 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 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 2.2.1 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 2.4 2.4.1 2.4.2 2.5 2.5.1 2.6 2.6.1 2.6.2 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.6.1 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.8.1 4.8.2 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.7.1 5.8 5.9 5.9.1 5.9.2 5.9.3 5.9.7 6.0 6.1 6.2 6.3 6.4 6.4.1 6.5 6.6 6.6.1 6.6.2 6.7 6.8 6.8.1 6.8.2 6.9 6.9.1 6.9.2 6.9.3 6.9.4 6.9.4.1 6.9.4.2 6.9.4.3 6.9.4.4 6.9.5
widget-google-reviews / includes / admin / class-admin-menu.php
widget-google-reviews / includes / admin Last commit date
class-admin-feed-columns.php 10 months ago class-admin-menu.php 2 years ago class-admin-notice.php 1 year ago class-admin-page.php 3 years ago class-admin-rateus-ajax.php 1 year ago class-admin-rev.php 1 year ago class-admin-tophead.php 1 year ago
class-admin-menu.php
102 lines
1 <?php
2
3 namespace WP_Rplg_Google_Reviews\Includes\Admin;
4
5 use WP_Rplg_Google_Reviews\Includes\Post_Types;
6
7 class Admin_Menu {
8
9 public function __construct() {
10
11 }
12
13 public function register() {
14 add_action('admin_menu', array($this, 'add_page'), 9);
15 add_action('admin_menu', array($this, 'add_subpages'));
16 add_filter('submenu_file', array($this, 'remove_submenu_pages'));
17 add_filter('admin_body_class', array($this, 'add_admin_body_class'));
18 }
19
20 public function add_page() {
21 add_menu_page(
22 'Google Reviews Plugin',
23 'Google Reviews',
24 'edit_posts',
25 'grw',
26 '',
27 GRW_ASSETS_URL . 'img/menu_icon.png',
28 25
29 );
30
31 $overview_page = new Admin_Page(
32 'grw',
33 'Overview',
34 'Overview',
35 'edit_posts',
36 'grw'
37 );
38 $overview_page->add_page();
39 }
40
41 public function add_subpages() {
42 $builder_page = new Admin_Page(
43 'grw',
44 'Reviews Builder',
45 'Builder',
46 'edit_posts',
47 'grw-builder'
48 );
49 $builder_page->add_page();
50
51 $setting_page = new Admin_Page(
52 'grw',
53 'Settings',
54 'Settings',
55 'manage_options',
56 'grw-settings'
57 );
58 $setting_page->add_page();
59
60 $support_page = new Admin_Page(
61 'grw',
62 'Support',
63 'Support',
64 'manage_options',
65 'grw-support'
66 );
67 $support_page->add_page();
68 }
69
70 public function remove_submenu_pages($submenu_file) {
71 global $plugin_page;
72
73 $hidden_pages = array(
74 'grw-builder',
75 );
76
77 if ($plugin_page && in_array($plugin_page, $hidden_pages)) {
78 $submenu_file = 'edit.php?post_type=' . Post_Types::FEED_POST_TYPE;
79 }
80
81 foreach ($hidden_pages as $page) {
82 remove_submenu_page('grw', $page);
83 }
84
85 return $submenu_file;
86 }
87
88 public function add_admin_body_class($classes) {
89 $current_screen = get_current_screen();
90
91 if (empty($current_screen)) {
92 return;
93 }
94
95 if (strpos($current_screen->id, 'grw') !== false) {
96 $classes .= ' grw-admin ';
97 }
98 return $classes;
99 }
100
101 }
102