diff options
author | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2019-08-19 20:55:55 +0000 |
---|---|---|
committer | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2019-08-19 20:55:55 +0000 |
commit | 7aa4390a6702059342aad220e53e3aa4efc9caad (patch) | |
tree | b89bd5c2d78d4fce915629b2844a5a54ae6994ca | |
parent | aba9ae5fb48fa655d8ca01504efd4f6121ca41b5 (diff) | |
download | Post-SMTP-7aa4390a6702059342aad220e53e3aa4efc9caad.zip |
adding hooks
-rw-r--r-- | Postman/Postman-Configuration/PostmanConfigurationController.php | 3 | ||||
-rw-r--r-- | Postman/Postman-Mail/PostmanMailgunTransport.php | 6 | ||||
-rw-r--r-- | Postman/Postman-Mail/PostmanModuleTransport.php | 2 | ||||
-rw-r--r-- | Postman/Postman.php | 3 | ||||
-rw-r--r-- | Postman/PostmanOptions.php | 12 | ||||
-rw-r--r-- | postman-smtp.php | 1 |
6 files changed, 22 insertions, 5 deletions
diff --git a/Postman/Postman-Configuration/PostmanConfigurationController.php b/Postman/Postman-Configuration/PostmanConfigurationController.php index 6d5b6b5..a81605a 100644 --- a/Postman/Postman-Configuration/PostmanConfigurationController.php +++ b/Postman/Postman-Configuration/PostmanConfigurationController.php @@ -235,6 +235,9 @@ class PostmanConfigurationController { print '<div id="mailgun_settings" class="authentication_setting non-basic non-oauth2">'; do_settings_sections( PostmanMailgunTransport::MAILGUN_AUTH_OPTIONS ); print '</div>'; + + do_action( 'post_smtp_settings_sections' ); + print '</section>'; // end account config ?> diff --git a/Postman/Postman-Mail/PostmanMailgunTransport.php b/Postman/Postman-Mail/PostmanMailgunTransport.php index a673e01..63173db 100644 --- a/Postman/Postman-Mail/PostmanMailgunTransport.php +++ b/Postman/Postman-Mail/PostmanMailgunTransport.php @@ -154,9 +154,9 @@ class PostmanMailgunTransport extends PostmanAbstractModuleTransport implements // push the authentication options into the $overrideItem structure $overrideItem ['auth_items'] = array( array( - 'selected' => true, - 'name' => __( 'API Key', 'post-smtp' ), - 'value' => 'api_key', + 'selected' => true, + 'name' => __( 'API Key', 'post-smtp' ), + 'value' => 'api_key', ), ); return $overrideItem; diff --git a/Postman/Postman-Mail/PostmanModuleTransport.php b/Postman/Postman-Mail/PostmanModuleTransport.php index 37d692d..12d3d17 100644 --- a/Postman/Postman-Mail/PostmanModuleTransport.php +++ b/Postman/Postman-Mail/PostmanModuleTransport.php @@ -78,7 +78,7 @@ abstract class PostmanAbstractModuleTransport implements PostmanModuleTransport /** */ - public function __construct($rootPluginFilenameAndPath) { + public function __construct($rootPluginFilenameAndPath = null) { $this->logger = new PostmanLogger ( get_class ( $this ) ); $this->options = PostmanOptions::getInstance (); $this->rootPluginFilenameAndPath = $rootPluginFilenameAndPath; diff --git a/Postman/Postman.php b/Postman/Postman.php index 1610da5..71c7cfd 100644 --- a/Postman/Postman.php +++ b/Postman/Postman.php @@ -35,6 +35,8 @@ class Postman { private $pluginData; private $rootPluginFilenameAndPath; + public static $rootPlugin; + /** * The constructor * @@ -45,6 +47,7 @@ class Postman { assert( ! empty( $rootPluginFilenameAndPath ) ); assert( ! empty( $version ) ); $this->rootPluginFilenameAndPath = $rootPluginFilenameAndPath; + self::$rootPlugin = $rootPluginFilenameAndPath; // load the dependencies require_once 'PostmanOptions.php'; diff --git a/Postman/PostmanOptions.php b/Postman/PostmanOptions.php index 7d8c2a0..57fe658 100644 --- a/Postman/PostmanOptions.php +++ b/Postman/PostmanOptions.php @@ -164,6 +164,14 @@ if ( ! class_exists( 'PostmanOptions' ) ) { $this->load(); } + public function __call($method, $args) + { + if (isset($this->$method)) { + $func = $this->$method; + return call_user_func_array($func, $args); + } + } + public function save() { update_option( PostmanOptions::POSTMAN_OPTIONS, $this->options ); } @@ -172,7 +180,7 @@ if ( ! class_exists( 'PostmanOptions' ) ) { $this->load(); } - private function load() { + public function load() { $options = get_option( self::POSTMAN_OPTIONS ); @@ -189,6 +197,8 @@ if ( ! class_exists( 'PostmanOptions' ) ) { restore_current_blog(); } + do_action( 'post_smtp_options_load', $this ); + $this->options = $options; } diff --git a/postman-smtp.php b/postman-smtp.php index 3919867..4f4f706 100644 --- a/postman-smtp.php +++ b/postman-smtp.php @@ -129,4 +129,5 @@ function post_start( $startingMemory ) { function post_setupPostman() { require_once 'Postman/Postman.php'; $kevinCostner = new Postman( __FILE__, POST_SMTP_VER ); + do_action( 'post_smtp_init'); } |