Permalink
Browse files

Update to WordPress 4.8.1 (2/2) - includes bugfix for improved Panthe…

…on-specific update notice. For more information, see #131
  • Loading branch information...
Pantheon Automation authored and greg-1-anderson committed Aug 7, 2017
1 parent 6d51b33 commit 771b52e40e729f98338f09e55d8595a4b6df5e97
Showing with 20 additions and 5 deletions.
  1. +20 −5 wp-content/mu-plugins/pantheon/pantheon-updates.php
@@ -1,12 +1,15 @@
<?php
// Disable WordPress ato updates
// Disable WordPress auto updates
if( ! defined('WP_AUTO_UPDATE_CORE')) {
define( 'WP_AUTO_UPDATE_CORE', false );
}
remove_action( 'wp_maybe_auto_update', 'wp_maybe_auto_update' );
// Remove WordPress core update nag
add_action('admin_menu','_pantheon_hide_update_nag');
// Remove the default WordPress core update nag if on Pantheon
if( isset( $_ENV['PANTHEON_ENVIRONMENT'] ) ){
add_action('admin_menu','_pantheon_hide_update_nag');
}
function _pantheon_hide_update_nag() {
remove_action( 'admin_notices', 'update_nag', 3 );
}
@@ -55,15 +58,27 @@ function _pantheon_upstream_update_notice() {
<?php
}
// Register our admin notice
// Register Pantheon specific WordPress update admin notice
add_action( 'admin_init', '_pantheon_register_upstream_update_notice' );
function _pantheon_register_upstream_update_notice(){
// but only if we are on Pantheon and there is a WordPress update available
if( isset( $_ENV['PANTHEON_ENVIRONMENT'] ) && _pantheon_wordpress_update_available() ){
add_action( 'admin_notices', '_pantheon_upstream_update_notice' );
}
}
// Only in Test and Live Environments...
// Return zero updates and current time as last checked time
function _pantheon_disable_wp_updates() {
include ABSPATH . WPINC . '/version.php';
return (object) array(
'updates' => array(),
'version_checked' => $wp_version,
'last_checked' => time(),
);
}
// In the Test and Live environments, clear plugin/theme update notifications.
// Users must check a dev or multidev environment for updates.
if ( in_array( $_ENV['PANTHEON_ENVIRONMENT'], Array('test', 'live') ) ) {
// Disable Plugin Updates

0 comments on commit 771b52e

Please sign in to comment.