Plugin Directory

Changeset 218183


Ignore:
Timestamp:
03/16/2010 04:27:43 AM (16 years ago)
Author:
jkmassel
Message:
 
Location:
disable-upgrade-reminder/trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • disable-upgrade-reminder/trunk/disable-upgrade-reminder.php

    r158480 r218183  
    33 Plugin Name: Disable Upgrade Reminder
    44 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.
    66 Author: Jeremy Massel
    7  Version: 0.2
     7 Version: 0.3
    88 Author URI: http://www.masseltech.com/
    99 */
    1010
    11 /*  Copyright 2009  Jeremy Massel  (email : jkmassel@shaw.ca)
    12  This program is free software; you can redistribute it and/or modify
    13  it under the terms of the GNU General Public License as published by
    14  the Free Software Foundation; either version 2 of the License, or
    15  (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 of
    18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    19  GNU General Public License for more details.
    20  You should have received a copy of the GNU General Public License
    21  along with this program; if not, write to the Free Software
    22  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    23  */
    2411
    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;"));
     12class 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        }
    3331    }
     32   
     33    function removeVersionCheck()
     34    {
     35        remove_action('init', 'wp_version_check');
     36    }
     37   
     38    function doNothing($vars = '')
     39    {
     40        //no, seriously.
     41    }
    3442}
    3543
     44$disableUpgradeReminderPlugin = new disableUpgradeReminder();
     45
     46add_action('init', array($disableUpgradeReminderPlugin, 'do_disableUpgradeReminder'));
     47
    3648?>
  • disable-upgrade-reminder/trunk/readme.txt

    r158480 r218183  
    44Tags:
    55Requires at least: 2.8
    6 Tested up to: 2.8.4
    7 Stable tag: 0.2
     6Tested up to: 2.9.1
     7Stable tag: trunk
    88
    99Disable 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.
     
    3030* 0.2
    3131Fixed a problem with 0.1
     32
     33* 0.3
     34Added a small fix
    3235   
    3336== Screenshots ==
Note: See TracChangeset for help on using the changeset viewer.