diff options
author | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2020-01-13 06:59:45 +0000 |
---|---|---|
committer | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2020-01-13 06:59:45 +0000 |
commit | 3686a6e1793a2c5af8b7ee4459e20887f08dc720 (patch) | |
tree | 88f1846b220499ca3fe9809064ba5e6070e642d9 /Postman/Extensions | |
parent | 2850339b7b0f53042c2f27e7802e273c36d1cef8 (diff) | |
download | Post-SMTP-3686a6e1793a2c5af8b7ee4459e20887f08dc720.zip |
* Fixed: Notify on error bug - crash site
* Fixed: From header
Diffstat (limited to 'Postman/Extensions')
-rw-r--r-- | Postman/Extensions/Core/Notifications/PostmanNotify.php | 4 | ||||
-rw-r--r-- | Postman/Extensions/Core/Notifications/PostmanNotifyOptions.php | 13 |
2 files changed, 15 insertions, 2 deletions
diff --git a/Postman/Extensions/Core/Notifications/PostmanNotify.php b/Postman/Extensions/Core/Notifications/PostmanNotify.php index d9f6a58..ae505cf 100644 --- a/Postman/Extensions/Core/Notifications/PostmanNotify.php +++ b/Postman/Extensions/Core/Notifications/PostmanNotify.php @@ -15,9 +15,11 @@ class PostmanNotify { const NOTIFICATIONS_PUSHOVER_CRED = 'postman_pushover_cred'; const NOTIFICATIONS_SLACK_CRED = 'postman_slack_cred'; + private $options; + public function __construct() { - $this->options = new PostmanNotifyOptions(); + $this->options = PostmanNotifyOptions::getInstance(); add_filter( 'post_smtp_admin_tabs', array( $this, 'tabs' ) ); add_action( 'post_smtp_settings_menu', array( $this, 'menu' ) ); diff --git a/Postman/Extensions/Core/Notifications/PostmanNotifyOptions.php b/Postman/Extensions/Core/Notifications/PostmanNotifyOptions.php index 08c27db..2973eb9 100644 --- a/Postman/Extensions/Core/Notifications/PostmanNotifyOptions.php +++ b/Postman/Extensions/Core/Notifications/PostmanNotifyOptions.php @@ -12,7 +12,18 @@ class PostmanNotifyOptions { private $options; - public function __construct() + private static $instance; + + public static function getInstance() + { + if ( ! self::$instance ) { + self::$instance = new static; + } + + return self::$instance; + } + + private function __construct() { $this->options = get_option( 'postman_options' ); } |