This commit is contained in:
Javier Casares 2026-01-29 10:02:03 +00:00
commit a29b2d82ad
19 changed files with 3792 additions and 231 deletions

42
admin/index.php Normal file
View file

@ -0,0 +1,42 @@
<?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>