From a92a929c6c240d3b01c38f940ff854b3457ecd1c Mon Sep 17 00:00:00 2001 From: Mikhail Kobzarev Date: Mon, 10 Feb 2020 17:20:57 +0300 Subject: [PATCH 1/2] Set `autoload = no` for performance --- src/Dismiss.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Dismiss.php b/src/Dismiss.php index 2a72169..2b07868 100644 --- a/src/Dismiss.php +++ b/src/Dismiss.php @@ -156,6 +156,6 @@ private function dismiss_notice() { update_user_meta( get_current_user_id(), "{$this->prefix}_{$this->id}", true ); return; } - update_option( "{$this->prefix}_{$this->id}", true ); + update_option( "{$this->prefix}_{$this->id}", true, false ); } } From 5831dc117478f0586aa89c8b08e3eba0ba51920f Mon Sep 17 00:00:00 2001 From: Mikhail Kobzarev Date: Mon, 10 Feb 2020 21:59:49 +0300 Subject: [PATCH 2/2] Return lost argument `scope` --- src/Notice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Notice.php b/src/Notice.php index 78f1f7f..93ab0f1 100644 --- a/src/Notice.php +++ b/src/Notice.php @@ -146,7 +146,7 @@ public function __construct( $id, $title, $message, $options = [] ) { $this->allowed_html = apply_filters( 'wptrt_admin_notices_allowed_html', $this->allowed_html ); // Instantiate the Dismiss object. - $this->dismiss = new Dismiss( $this->id, $this->options['option_prefix'] ); + $this->dismiss = new Dismiss( $this->id, $this->options['option_prefix'], $this->options['scope'] ); } /**