Upgrade to WP Mail SMTP Pro!', 'wp-mail-smtp' ),
esc_url( $upgrade_link_url )
),
[
'a' => [
'href' => [],
'rel' => [],
'target' => [],
],
]
);
?>
additional connection, you can select it here.', 'wp-mail-smtp' ),
add_query_arg(
[
'tab' => 'connections',
],
wp_mail_smtp()->get_admin()->get_admin_page_url()
)
),
[
'a' => [
'href' => [],
'target' => [],
'rel' => [],
],
]
);
?>
check_admin_referer();
$connection = wp_mail_smtp()->get_connections_manager()->get_primary_connection();
$connection_settings = new ConnectionSettings( $connection );
$old_data = $connection->get_options()->get_all();
$data = $connection_settings->process( $data, $old_data );
/**
* Filters mail settings before save.
*
* @since 2.2.1
*
* @param array $data Settings data.
*/
$data = apply_filters( 'wp_mail_smtp_settings_tab_process_post', $data );
// All the sanitization is done in Options class.
Options::init()->set( $data, false, false );
$connection_settings->post_process( $data, $old_data );
if ( $connection_settings->get_scroll_to() !== false ) {
// phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotValidated
wp_safe_redirect( sanitize_text_field( wp_unslash( $_POST['_wp_http_referer'] ) ) . $connection_settings->get_scroll_to() );
exit;
}
WP::add_admin_notice(
esc_html__( 'Settings were successfully saved.', 'wp-mail-smtp' ),
WP::ADMIN_NOTICE_SUCCESS
);
}
}