Support » Plugin: Disable WordPress Core Updates » PHP Notices

  • In both 3.4.2 and 3.5-RC5, visiting /wp-admin/update-core.php with this plugin enabled causes nine PHP Notices to be displayed. Could you please fix this?

    This is all you have to do:

    add_filter( 'site_transient_update_core', 'break_updates', 10, 1 );
    function break_updates($update) {
    	if ( isset($update->response) and 'latest' != $update->response and 'development' != $update->response )
    		$update->response = 'latest';
    	return $update;

    And by the way, this plugin doesn’t disable update checking. The plugin description is not accurate.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Correction, it looks like the value of the update_core transient is an array, not an object. I’ll work on this some more. Do you have any interest in collaborating on this? Otherwise, I’ll just end up using my own plugin from scratch.

    Plugin Author John Blackbourn


    Thanks for the code you sent the other day on IRC Robert. I’ll get an update out shortly.

    As Robert Chapin said the problem is that it will ping for updates on every load when these filters are set (so it seems).

    I have used this to remove it it from pinging for updates and the nag screen,

    function remove_core_updates(){
            global $wp_version;
            return (object) array(
                'last_checked' => time(),
                'version_checked' => $wp_version,
    add_filter('pre_site_transient_update_core', 'remove_core_updates');
    add_filter('pre_site_transient_update_plugins', 'remove_core_updates');
    add_filter('pre_site_transient_update_themes', 'remove_core_updates');

    It still throws a PHP warning ““Trying to get property of non-object”, no idea how to fix that without changing core, also there seems to be no way to hook into dismissed_updates.

    Hi wycks,

    I’ll just share the code I came up with. John might be too busy to work on his own code.

     * Plugin Name:  Disable Core Update
     * Description:  Disables WordPress core update notifications.
     * Version:      1.1
     * Author:       Robert Chapin (miqrogroove)
     * Author URI:
     * @license GPL
    add_filter( 'site_transient_update_core', 'break_updates', 10, 1 );
    remove_action( 'wp_version_check', 'wp_version_check' );
    remove_action( 'admin_init', '_maybe_update_core' );
    function break_updates($from_api) {
    	if ( !isset( $from_api->updates ) || !is_array( $from_api->updates ) ) return $from_api;
    	foreach($from_api->updates as $i => $update) {
    		if ( isset($update->response) and 'latest' != $update->response and 'development' != $update->response ) {
    			$from_api->updates[$i]->response = 'latest';
    	return $from_api;

    Thanks Robert Chapin , unfortunately that does not remove it from pinging for updates on every re-refresh, as far as I can tell it will still check for updates. This might have to be a trac issue.

    Trying to set pre_site_transient_update_core to remove pings results in:

    Trying to get property of non-object
    list_core_update( )  update-core.php:156

    As I mentioned in the first post, this plugin doesn’t disable update checking.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘PHP Notices’ is closed to new replies.