Changeset 1384851
- Timestamp:
- 04/02/2016 06:46:48 AM (10 years ago)
- Location:
- menus/trunk
- Files:
-
- 2 edited
-
ds_wp3_menus.php (modified) (8 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
menus/trunk/ds_wp3_menus.php
r802837 r1384851 3 3 Plugin Name: Menus 4 4 Plugin URI: http://wordpress.org/extend/plugins/menus/ 5 Version: 3.7.16 Description: W P3.7.1 Multisite "mu-plugin"to toggle more of the administration menus in the same way "Plugins" is already toggled. Go to Network-->Settings->Menu Settings to "Enable administration menus". All menus are unchecked and disabled by default, except when logged in as Network Admin.5 Version: 4.3 6 Description: Wordpress Multisite Network plugin to toggle more of the administration menus in the same way "Plugins" is already toggled. Go to Network-->Settings->Menu Settings to "Enable administration menus". All menus are unchecked and disabled by default, except when logged in as Network Admin. 7 7 Author: dsader 8 8 Author URI: http://dsader.snowotherway.org … … 34 34 add_action( 'admin_page_access_denied', array(&$this, 'ds_access_denied_splash'), 99 ); 35 35 36 37 $menu_perms = get_site_option( "menu_items" ); 38 if( !isset($menu_perms[ 'app_cus' ]) ) { 39 add_action( 'admin_init', array(&$this, 'ds_customize'), 10 ); 40 add_filter( 'init', array(&$this,'ds_removecustmizer_metacap'), 10 ); 41 } 42 36 43 } 37 44 //------------------------------------------------------------------------// 38 45 //---Functions to Enable/Disable admin menus------------------------------// 39 46 //------------------------------------------------------------------------// 47 48 function ds_customize() { 49 remove_action( 'plugins_loaded', '_wp_customize_include', 10); 50 remove_action( 'admin_enqueue_scripts', '_wp_customize_loader_settings', 11); 51 add_action( 'load-customize.php', array(&$this, 'ds_override_load_customizer_action') ); 52 } 53 function ds_override_load_customizer_action() { 54 wp_die( __( 'The Customizer is currently disabled.' ) ); 55 } 56 function ds_removecustmizer_metacap() { 57 add_filter( 'map_meta_cap', array(&$this,'ds_removecustmizer_metacap_filter'), 10, 4 ); 58 59 } 60 function ds_removecustmizer_metacap_filter( $caps = array(), $cap = '', $user_id = 0, $args = array() ) { 61 if ($cap == 'customize' ) { 62 return array( 'nope' ); //thanx wp-crap 63 } 64 return $caps; 65 } 66 40 67 function ds_access_denied_splash() { 41 68 //redirects WP "You do not have sufficient permissions to access this page." to dashboard or add custom message instead. … … 88 115 } 89 116 90 if( !isset($menu_perms[ 'jetpack_jetpack' ]) && current_user_can(' manage_options')) {117 if( !isset($menu_perms[ 'jetpack_jetpack' ]) && current_user_can('jetpack_manage_modules')) { 91 118 remove_submenu_page( 'jetpack', 'jetpack' ); 92 119 if( strpos($_SERVER['REQUEST_URI'], 'jetpack')) 93 120 { wp_redirect( $redirect ); exit(); } 94 121 } 122 123 124 if( !isset($menu_perms[ 'jetpack_modules' ]) && current_user_can('manage_options')) { 125 remove_submenu_page( 'jetpack', 'jetpack_modules' ); 126 if( strpos($_SERVER['REQUEST_URI'], 'jetpack_modules')) 127 { wp_redirect( $redirect ); exit(); } 128 } 129 95 130 96 131 if( !isset($menu_perms[ 'jetpack_akismet_key_config' ]) && current_user_can('manage_options')) { … … 107 142 108 143 } 144 145 146 109 147 110 148 function ds_reduce_favorite_actions ($wp_toolbar) { … … 332 370 333 371 // 'Appearance Customize' 334 if( !isset($menu_perms[ 'app_cus' ]) && current_user_can('edit_theme_options')) { 335 remove_submenu_page( 'themes.php', 'customize.php' ); 372 if( !isset($menu_perms[ 'app_cus' ]) && current_user_can('edit_theme_options')) { 373 if(!empty($submenu['themes.php'])) { 374 foreach($submenu['themes.php'] as $key => $sm) { 375 if(__($sm[0]) == __('Customize') || $sm[2] == "customize.php") { 376 unset($submenu['themes.php'][$key]); 377 break; 378 } 379 } 380 } 336 381 if( strpos($_SERVER['REQUEST_URI'], 'customize.php')) 337 382 { wp_redirect( $redirect ); exit(); } 338 383 } 384 339 385 340 386 // 'Appearance Widgets' … … 359 405 } 360 406 407 // 'Appearance Header' 408 if( !isset($menu_perms[ 'app_back' ]) && current_user_can('edit_theme_options')) { 409 remove_submenu_page( 'themes.php', 'custom-background' ); 410 if( strpos($_SERVER['REQUEST_URI'], 'custom-background')) 411 { wp_redirect( $redirect ); exit(); } 412 } 413 361 414 // 'Plugins Plugins' 362 415 if( !isset($menu_perms[ 'plug_plug' ]) && current_user_can('activate_plugins')) { … … 501 554 'menu_jetpack' => __('Jetpack'), 502 555 'jetpack_jetpack' => __('Jetpack Jetpack'), 556 'jetpack_modules' => __('Jetpack Settings'), 503 557 'jetpack_akismet_key_config' => __('Akismet'), 504 558 'jetpack_akismet_stats_display' => __('Akismet Stats'), … … 527 581 'app_men' => __('Appearance Menus'), 528 582 'app_head' => __('Appearance Header'), 583 'app_back' => __('Appearance Background'), 529 584 'plugins' => __( 'Plugins' ), 530 585 'plug_plug' => __('Plugins Plugins'), -
menus/trunk/readme.txt
r1384628 r1384851 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 11 A Multisite Network plugin to toggle admin stration menus for the entire network of sites.11 A Multisite Network plugin to toggle administration menus for the entire network of sites. 12 12 13 13 == Description == 14 Enable or disable WordPress [Multisite](http://codex.wordpress.org/Create_A_Network) Backend Menus. Adds options to toggle administration menus at Network Admin->Settings page under "Menu Settings". WP3already toggles the Plugins menu, I've added a bunch more in the same/similar way.14 Enable or disable WordPress [Multisite](http://codex.wordpress.org/Create_A_Network) backend menus. Adds options to toggle administration menus at Network Admin->Settings page under "Menu Settings". WP already toggles the Plugins menu, I've added a bunch more in the same/similar way. 15 15 16 I use the plugin to simplify the menus available to the entire network of sites. I use this plugin in a WP3.5 Multisite installation to disable the Deltete Blog, Permalinks, Import, Add Users and Themesmenus.16 I use the plugin to simplify the menus available to the entire network of sites. I use this plugin in a Multisite installation to disable the Delete Blog, Permalinks, Import, Add Users and Theme customizer menus. 17 17 18 18 The plugin also removes some of the admin bar menu items as well. … … 23 23 24 24 1. Upload the plugin to your blog, Network Activate it 25 2. Set multisite "Menu Settings" option at Network->Settings page25 2. Set multisite "Menu Settings" options at Network->Settings page 26 26 27 27 == Frequently Asked Questions == 28 28 29 29 * Will this plugin also hide menus added by plugins? Maybe, if the parent page is hidden. Snoop into the code to see how to add your own remove_menu_page items. 30 * Will this plugin hide the corresponding items from the admin head favo rites and toolbar? Yes. The +New and a couple others can be toggled30 * Will this plugin hide the corresponding items from the admin head favourites and toolbar? Yes. The +New and a couple others can be toggled 31 31 * Will this plugin disable media uploads? Yes. Well, from the Media menus at least. 32 32 * Will this plugin hide the media upload buttons? No. The Media Upload Buttons in the edit post/page form can be removed with my Toggle Meta Boxes Sitewide plugin. 33 * Can I have different menus for different roles of users on different blogs? No, this plugin toggles menus for all users and all blogs regardless of Cap/Role (only SuperAdmin can over ide the limits of the plugin however).33 * Can I have different menus for different roles of users on different blogs? No, this plugin toggles menus for all users and all blogs regardless of Cap/Role (only SuperAdmin can override the limits of the plugin however). 34 34 35 35 == Screenshots == 36 36 37 1. Menu Settings: Enable Admin stration Menus37 1. Menu Settings: Enable Administration Menus 38 38 2. Admin Bar Dropdown Shortcuts 39 39 40 40 == Changelog == 41 = 4.3 = 42 * Tested up to: WP 4.5, hides Customizer by default, enable @ Network->Settings 43 41 44 = 3.7.1 = 42 45 * Tested up to: WP 3.7.1 major rewrite for 3.7.1 43 46 44 47 == Upgrade Notice == 45 = 3.7.1=46 * Tested up to: WP 3.7.148 = 4.3 = 49 * Tested up to: WP 4.5, hides Customizer by default, enable @ Network->Settings
Note: See TracChangeset
for help on using the changeset viewer.