diff options
author | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2019-02-17 20:56:03 +0000 |
---|---|---|
committer | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2019-02-17 20:56:03 +0000 |
commit | f627e0d82c18a1ed60eead38ce38746ded43adc6 (patch) | |
tree | 0a3ef3c2266b717a3880c0c4c6edcdc3aae7c275 /Postman/PostmanAdminController.php | |
parent | a04f57be50a9ce581d8a48acd817d2788958a1dd (diff) | |
download | Post-SMTP-f627e0d82c18a1ed60eead38ce38746ded43adc6.zip |
= 1.9.7 - 2019-02-17
* New: Fallback Feature - Configure a backup SMTP when emails are failing.
* New: WordPress Multisite compability - with global settings.
* New: Email Log capability - give other user cheking the logs.
* Fixed: compatibility with mailster plugin
* Fixed: Mandrill exception bug - Thanks to Niels de Blaauw from Level-Level
Diffstat (limited to 'Postman/PostmanAdminController.php')
-rw-r--r-- | Postman/PostmanAdminController.php | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/Postman/PostmanAdminController.php b/Postman/PostmanAdminController.php index 03a7109..f85e30c 100644 --- a/Postman/PostmanAdminController.php +++ b/Postman/PostmanAdminController.php @@ -136,6 +136,17 @@ if ( ! class_exists( 'PostmanAdminController' ) ) { 'on_init', ) ); + // continue to initialize the AdminController + add_action( 'wpmu_options', array( + $this, + 'wpmu_options', + ) ); + + add_action( 'update_wpmu_options', array( + $this, + 'update_wpmu_options', + ) ); + // Adds "Settings" link to the plugin action page add_filter( 'plugin_action_links_' . plugin_basename( $this->rootPluginFilenameAndPath ), array( $this, @@ -145,6 +156,68 @@ if ( ! class_exists( 'PostmanAdminController' ) ) { require_once( 'PostmanPluginFeedback.php' ); } + + function wpmu_options() { + $options = get_site_option( PostmanOptions::POSTMAN_NETWORK_OPTIONS ); + ?> + <input type="hidden" name="<?php echo PostmanOptions::POSTMAN_NETWORK_OPTIONS; ?>[post_smtp_global_settings]" value="null"> + <input type="hidden" name="<?php echo PostmanOptions::POSTMAN_NETWORK_OPTIONS; ?>[post_smtp_allow_overwrite]" value="null"> + <h2><?php _e( 'Post SMTP Settings', Postman::TEXT_DOMAIN ); ?></h2> + <table id="menu" class="form-table"> + <tr> + <th scope="row"> + <?php _e( 'Enable global settings', Postman::TEXT_DOMAIN ); ?> + </th> + <td> + <?php $checked = checked( $options['post_smtp_global_settings'], 1, false ); ?> + <label for="post-smtp-global-settings"> + <input id="post-smtp-global-settings" type="checkbox" + name="<?php echo PostmanOptions::POSTMAN_NETWORK_OPTIONS; ?>[post_smtp_global_settings]" + value="1" + <?php echo $checked; ?> + > + <p class="description"> + <?php _e('Same settings as the main site/blog (id:1)', Postman::TEXT_DOMAIN ); ?> + </p> + </label> + </td> + </tr> + <tr> + <th scope="row"> + <?php _e( 'Allow user to load saved options', Postman::TEXT_DOMAIN ); ?> + </th> + <td> + <?php $checked = checked( $options['post_smtp_allow_overwrite'], 1, false ); ?> + <label for="post-smtp-allow-overwrite"> + <input id="post-smtp-allow-overwrite" type="checkbox" + name="<?php echo PostmanOptions::POSTMAN_NETWORK_OPTIONS; ?>[post_smtp_allow_overwrite]" + value="1" + <?php echo $checked; ?> + > + </label> + </td> + </tr> + </table> + <?php + } + + function update_wpmu_options() { + $options = get_site_option( PostmanOptions::POSTMAN_NETWORK_OPTIONS ); + if ( isset( $_POST[ PostmanOptions::POSTMAN_NETWORK_OPTIONS ] ) ) { + foreach ( $_POST[ PostmanOptions::POSTMAN_NETWORK_OPTIONS ] as $key => $value ) { + $options[$key] = sanitize_text_field( $value ); + + if ( $value == 'null' ) { + unset( $options[$key] ); + } + } + + update_site_option( PostmanOptions::POSTMAN_NETWORK_OPTIONS, $options ); + } else { + update_site_option( PostmanOptions::POSTMAN_NETWORK_OPTIONS, array() ); + } + } + /** * Functions to execute on the init event * |