CoreAdmin.php
6 years ago
admin.php
5 years ago
backup-handler.php
5 years ago
backup.php
5 years ago
cap-helper.php
6 years ago
filters-admin.php
6 years ago
filters-woocommerce.php
7 years ago
filters-wp_rest_workarounds.php
6 years ago
filters.php
6 years ago
functions-admin.php
6 years ago
functions.php
5 years ago
handler.php
5 years ago
inflect-cme.php
7 years ago
manager.php
6 years ago
network.php
6 years ago
pp-handler.php
6 years ago
pp-ui.php
6 years ago
publishpress-roles.php
6 years ago
functions-admin.php
52 lines
| 1 | <?php |
| 2 | |
| 3 | // perf enhancement: display submenu links without loading framework and plugin code |
| 4 | function cme_submenus() { |
| 5 | // First we check if user is administrator and can 'manage_capabilities'. |
| 6 | if (current_user_can('administrator') && ! current_user_can('manage_capabilities')) { |
| 7 | if ($admin = get_role('administrator')) { |
| 8 | $admin->add_cap('manage_capabilities'); |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | $cap_name = (is_multisite() && is_super_admin()) ? 'read' : 'manage_capabilities'; |
| 13 | |
| 14 | $permissions_title = __('Capabilities', 'capsman-enhanced'); |
| 15 | |
| 16 | $menu_order = 72; |
| 17 | |
| 18 | if (defined('PUBLISHPRESS_PERMISSIONS_MENU_GROUPING')) { |
| 19 | foreach (get_option('active_plugins') as $plugin_file) { |
| 20 | if ( false !== strpos($plugin_file, 'publishpress.php') ) { |
| 21 | $menu_order = 27; |
| 22 | } |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | add_menu_page( |
| 27 | $permissions_title, |
| 28 | $permissions_title, |
| 29 | $cap_name, |
| 30 | 'capsman', |
| 31 | 'cme_fakefunc', |
| 32 | 'dashicons-admin-network', |
| 33 | $menu_order |
| 34 | ); |
| 35 | |
| 36 | add_submenu_page('capsman', __('Backup', 'capsman-enhanced'), __('Backup', 'capsman-enhanced'), $cap_name, 'capsman' . '-tool', 'cme_fakefunc'); |
| 37 | |
| 38 | if (!defined('PUBLISHPRESS_CAPS_PRO_VERSION')) { |
| 39 | add_submenu_page( |
| 40 | 'capsman', |
| 41 | __('Upgrade to Pro', 'capsman-enhanced'), |
| 42 | __('Upgrade to Pro', 'capsman-enhanced'), |
| 43 | 'manage_capabilities', |
| 44 | 'capabilities-pro', |
| 45 | 'cme_fakefunc' |
| 46 | ); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | function cme_fakefunc() { |
| 51 | } |
| 52 |