Changeset 218183
- Timestamp:
- 03/16/2010 04:27:43 AM (16 years ago)
- Location:
- disable-upgrade-reminder/trunk
- Files:
-
- 1 added
- 2 edited
-
.project (added)
-
disable-upgrade-reminder.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
disable-upgrade-reminder/trunk/disable-upgrade-reminder.php
r158480 r218183 3 3 Plugin Name: Disable Upgrade Reminder 4 4 Plugin URI: http://masseltech.com/plugins/disable-upgrade-reminder/ 5 Description: Disable upgrade reminder is a plugin that disables the upgrade reminder at the top of the WordPress interface for all users except administrators. It is useful for any situation when you don't want anybody except admins worrying about available updates. 5 Description: Disable upgrade reminder is a plugin that disables the upgrade reminder at the top of the WordPress interface for all users except administrators. It is useful for any situation when you don't want anybody except admins worrying about available updates. Based on Disable WordPress Core Update by John Blackbourn. The only difference is that this doesn't disable the warning for administrators. 6 6 Author: Jeremy Massel 7 Version: 0. 27 Version: 0.3 8 8 Author URI: http://www.masseltech.com/ 9 9 */ 10 10 11 /* Copyright 2009 Jeremy Massel (email : jkmassel@shaw.ca)12 This program is free software; you can redistribute it and/or modify13 it under the terms of the GNU General Public License as published by14 the Free Software Foundation; either version 2 of the License, or15 (at your option) any later version.16 This program is distributed in the hope that it will be useful,17 but WITHOUT ANY WARRANTY; without even the implied warranty of18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the19 GNU General Public License for more details.20 You should have received a copy of the GNU General Public License21 along with this program; if not, write to the Free Software22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA23 */24 11 25 26 add_action('admin_init', 'do_disableUpgradeReminder'); 27 28 29 function do_disableUpgradeReminder() { 30 if (!current_user_can('edit_users')) { 31 add_action('init', create_function('$a', "remove_action( 'init', 'wp_version_check' );"), 2); 32 add_filter('pre_option_update_core', create_function('$a', "return null;")); 12 class disableUpgradeReminder 13 { 14 function do_disableUpgradeReminder() 15 { 16 if (!current_user_can('edit_users')) 17 { 18 19 //old versions 20 add_action('init', array($this, 'removeVersionCheck')); 21 add_filter('pre_option_update_core', 'doNothing'); 22 23 //newer versions 24 remove_action('wp_version_check', 'wp_version_check'); 25 remove_action('admin_init', '_maybe_update_core'); 26 add_filter('pre_transient_update_core', 'doNothing'); 27 28 //mu versions 29 add_filter('pre_site_transient_update_core', 'doNothing'); 30 } 33 31 } 32 33 function removeVersionCheck() 34 { 35 remove_action('init', 'wp_version_check'); 36 } 37 38 function doNothing($vars = '') 39 { 40 //no, seriously. 41 } 34 42 } 35 43 44 $disableUpgradeReminderPlugin = new disableUpgradeReminder(); 45 46 add_action('init', array($disableUpgradeReminderPlugin, 'do_disableUpgradeReminder')); 47 36 48 ?> -
disable-upgrade-reminder/trunk/readme.txt
r158480 r218183 4 4 Tags: 5 5 Requires at least: 2.8 6 Tested up to: 2. 8.47 Stable tag: 0.26 Tested up to: 2.9.1 7 Stable tag: trunk 8 8 9 9 Disable upgrade reminder is a plugin that disables the upgrade reminder at the top of the WordPress interface for all users except administrators. It is useful for any situation when you don't want anybody except admins worrying about available updates. … … 30 30 * 0.2 31 31 Fixed a problem with 0.1 32 33 * 0.3 34 Added a small fix 32 35 33 36 == Screenshots ==
Note: See TracChangeset
for help on using the changeset viewer.