Skip to content

Commit

Permalink
Merge pull request #46 from pantheon-systems/wp-redis-helpful-error
Browse files Browse the repository at this point in the history
Display a more helpful message if WP Redis has errors on Pantheon
  • Loading branch information
Josh Koenig committed Oct 31, 2015
2 parents 962c370 + 83034c2 commit 038e297
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions wp-content/mu-plugins/pantheon/pantheon-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ protected function setup() {
add_action( 'wp_before_admin_bar_render', array( $this, 'cache_admin_bar_render' ) );
}

add_action( 'admin_notices', function(){
global $wp_object_cache;
if ( empty( $wp_object_cache->missing_redis_message ) ) {
return;
}
$wp_object_cache->missing_redis_message = 'Alert! The Pantheon Redis service needs to be enabled before the WP Redis object cache will function properly.';
}, 9 ); // Before the message is displayed in the plugin notice.

add_action( 'shutdown', array( $this, 'cache_clean_urls' ), 999 );
}

Expand Down

0 comments on commit 038e297

Please sign in to comment.