diff --git a/stream.php b/stream.php index afce76ace..85fb48640 100755 --- a/stream.php +++ b/stream.php @@ -77,6 +77,9 @@ private function __construct() { // Install the plugin add_action( 'wp_stream_before_db_notices', array( __CLASS__, 'install' ) ); + // Trigger admin notices + add_action( 'all_admin_notices', array( __CLASS__, 'admin_notices' ) ); + // Load languages add_action( 'plugins_loaded', array( __CLASS__, 'i18n' ) ); @@ -248,7 +251,7 @@ public static function is_valid_php_version() { } /** - * Show an error or other message, using admin_notice or WP-CLI logger + * Handle notice messages according to the appropriate context (WP-CLI or the WP Admin) * * @param string $message * @param bool $is_error @@ -263,15 +266,28 @@ public static function notice( $message, $is_error = true ) { WP_CLI::success( $message ); } } else { - $print_message = function () use ( $message, $is_error ) { - $class_name = ( $is_error ? 'error' : 'updated' ); - $html_message = sprintf( '