Title: PHP Notices
Last modified: August 20, 2016

---

# PHP Notices

 *  [Robert Chapin](https://wordpress.org/support/users/miqrogroove/)
 * (@miqrogroove)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/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.
 * [http://wordpress.org/extend/plugins/disable-wordpress-core-update/](http://wordpress.org/extend/plugins/disable-wordpress-core-update/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [Robert Chapin](https://wordpress.org/support/users/miqrogroove/)
 * (@miqrogroove)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/php-notices/#post-3252488)
 * 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](https://wordpress.org/support/users/johnbillion/)
 * (@johnbillion)
 * WordPress Core Developer
 * [13 years, 5 months ago](https://wordpress.org/support/topic/php-notices/#post-3252496)
 * Thanks for the code you sent the other day on IRC Robert. I’ll get an update 
   out shortly.
 *  [wycks](https://wordpress.org/support/users/wycks/)
 * (@wycks)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/php-notices/#post-3252503)
 * 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`.
 *  Thread Starter [Robert Chapin](https://wordpress.org/support/users/miqrogroove/)
 * (@miqrogroove)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/php-notices/#post-3252504)
 * Hi wycks,
 * I’ll just share the code I came up with. John might be too busy to work on his
   own code.
 *     ```
       <?php
       /**
        * Plugin Name:  Disable Core Update
        * Description:  Disables WordPress core update notifications.
        * Version:      1.1
        * Author:       Robert Chapin (miqrogroove)
        * Author URI:   http://www.miqrogroove.com/
        * @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;
       }
       ?>
       ```
   
 *  [wycks](https://wordpress.org/support/users/wycks/)
 * (@wycks)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/php-notices/#post-3252506)
 * 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
       ```
   
 *  Thread Starter [Robert Chapin](https://wordpress.org/support/users/miqrogroove/)
 * (@miqrogroove)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/php-notices/#post-3252507)
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/disable-wordpress-core-update.svg)
 * [Disable WordPress Core Updates](https://wordpress.org/plugins/disable-wordpress-core-update/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/disable-wordpress-core-update/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/disable-wordpress-core-update/)
 * [Active Topics](https://wordpress.org/support/plugin/disable-wordpress-core-update/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/disable-wordpress-core-update/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/disable-wordpress-core-update/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [Robert Chapin](https://wordpress.org/support/users/miqrogroove/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/php-notices/#post-3252507)
 * Status: not resolved