42 lines
1.3 KiB
PHP
42 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* Admin settings page for SMTP (by ROBOTSTXT) Newsletter.
|
|
*
|
|
* This file is loaded by NewsletterMailerAddon parent class.
|
|
*
|
|
* @package ROBOTSTXT_SMTP_Newsletter
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
// Load settings page class and ensure settings are registered.
|
|
require_once ROBOTSTXT_SMTP_NEWSLETTER_PATH . 'admin/class-settings-page.php';
|
|
$settings_page = \Robotstxt_SMTP_Newsletter\Admin\Settings_Page::get_instance();
|
|
|
|
// Register settings now.
|
|
$settings_page->register_settings();
|
|
|
|
// Handle form submission.
|
|
if ( isset( $_POST['robotstxt_smtp_newsletter_options'] ) && check_admin_referer( 'robotstxt_smtp_newsletter-options' ) ) {
|
|
$options = $settings_page->sanitize_options( $_POST['robotstxt_smtp_newsletter_options'] );
|
|
update_option( 'robotstxt_smtp_newsletter_options', $options );
|
|
|
|
echo '<div class="notice notice-success is-dismissible"><p>';
|
|
esc_html_e( 'Settings saved.', 'robotstxt-smtp-newsletter' );
|
|
echo '</p></div>';
|
|
}
|
|
?>
|
|
|
|
<div class="wrap">
|
|
<h1><?php esc_html_e( 'SMTP (by ROBOTSTXT) Newsletter Settings', 'robotstxt-smtp-newsletter' ); ?></h1>
|
|
|
|
<form method="post" action="">
|
|
<?php
|
|
wp_nonce_field( 'robotstxt_smtp_newsletter-options' );
|
|
do_settings_sections( 'robotstxt_smtp_newsletter' );
|
|
submit_button();
|
|
?>
|
|
</form>
|
|
</div>
|