This commit is contained in:
2026-03-11 15:57:27 +01:00
parent 481271c972
commit b4b460fd21
10775 changed files with 2071579 additions and 26409 deletions

View File

@@ -1,89 +1,64 @@
<?php defined( 'ABSPATH' ) or exit; ?>
<?php defined('ABSPATH') or exit; ?>
<div id="mc4wp-admin" class="wrap mc4wp-settings">
<div class="mc4wp-row">
<div class="main-content mc4wp-col">
<h1 class="mc4wp-page-title">
<?php echo esc_html__('Add new form', 'mailchimp-for-wp'); ?>
</h1>
<h2 style="display: none;"></h2><?php // fake h2 for admin notices ?>
<div style="max-width: 480px;">
<form method="post">
<input type="hidden" name="_mc4wp_action" value="add_form" />
<?php wp_nonce_field('_mc4wp_action', '_wpnonce'); ?>
<div class="mc4wp-margin-s">
<h3>
<label>
<?php echo esc_html__('What is the name of this form?', 'mailchimp-for-wp'); ?>
</label>
</h3>
<input type="text" name="mc4wp_form[name]" class="widefat" value="" spellcheck="true" autocomplete="off" placeholder="<?php echo esc_attr__('Enter your form title..', 'mailchimp-for-wp'); ?>">
</div>
<div class="mc4wp-margin-s">
<h3>
<label>
<?php echo esc_html__('To which Mailchimp audience should this form subscribe?', 'mailchimp-for-wp'); ?>
</label>
</h3>
<div class="mc4wp-row">
<!-- Main Content -->
<div class="main-content mc4wp-col">
<h1 class="mc4wp-page-title">
<?php echo esc_html__( 'Add new form', 'mailchimp-for-wp' ); ?>
</h1>
<h2 style="display: none;"></h2><?php // fake h2 for admin notices ?>
<div style="max-width: 480px;">
<!-- Wrap entire page in <form> -->
<form method="post">
<input type="hidden" name="_mc4wp_action" value="add_form" />
<?php wp_nonce_field( '_mc4wp_action', '_wpnonce' ); ?>
<div class="mc4wp-margin-s">
<h3>
<label>
<?php echo esc_html__( 'What is the name of this form?', 'mailchimp-for-wp' ); ?>
</label>
</h3>
<input type="text" name="mc4wp_form[name]" class="widefat" value="" spellcheck="true" autocomplete="off" placeholder="<?php echo esc_attr__( 'Enter your form title..', 'mailchimp-for-wp' ); ?>">
</div>
<div class="mc4wp-margin-s">
<h3>
<label>
<?php echo esc_html__( 'To which Mailchimp lists should this form subscribe?', 'mailchimp-for-wp' ); ?>
</label>
</h3>
<?php
if ( ! empty( $lists ) ) {
?>
<ul id="mc4wp-lists">
<?php
foreach ( $lists as $list ) {
?>
<li>
<label>
<input type="checkbox" name="mc4wp_form[settings][lists][<?php echo esc_attr( $list->id ); ?>]" value="<?php echo esc_attr( $list->id ); ?>" <?php checked( $number_of_lists, 1 ); ?> >
<?php echo esc_html( $list->name ); ?>
</label>
</li>
<?php
}
?>
</ul>
<?php
} else {
?>
<p class="mc4wp-notice">
<?php echo sprintf( wp_kses( __( 'No lists found. Did you <a href="%s">connect with Mailchimp</a>?', 'mailchimp-for-wp' ), array( 'a' => array( 'href' => array() ) ) ), admin_url( 'admin.php?page=mailchimp-for-wp' ) ); ?>
</p>
<?php
}
?>
</div>
<?php submit_button( esc_html__( 'Add new form', 'mailchimp-for-wp' ) ); ?>
</form><!-- Entire page form wrap -->
</div>
<?php require MC4WP_PLUGIN_DIR . '/includes/views/parts/admin-footer.php'; ?>
</div><!-- / Main content -->
<!-- Sidebar -->
<div class="mc4wp-sidebar mc4wp-col">
<?php require MC4WP_PLUGIN_DIR . '/includes/views/parts/admin-sidebar.php'; ?>
</div>
</div>
<?php
if (! empty($lists)) {
?>
<ul id="mc4wp-lists">
<?php
foreach ($lists as $list) {
?>
<li>
<label>
<input type="checkbox" name="mc4wp_form[settings][lists][<?php echo esc_attr($list->id); ?>]" value="<?php echo esc_attr($list->id); ?>" <?php checked($number_of_lists, 1); ?> >
<?php echo esc_html($list->name); ?>
</label>
</li>
<?php
}
?>
</ul>
<?php
} else {
?>
<p class="mc4wp-notice">
<?php echo sprintf(wp_kses(__('No Mailchimp audiences found. Did you <a href="%s">connect with Mailchimp</a>?', 'mailchimp-for-wp'), [ 'a' => [ 'href' => [] ] ]), admin_url('admin.php?page=mailchimp-for-wp')); ?>
</p>
<?php
}
?>
</div>
<?php submit_button(esc_html__('Add new form', 'mailchimp-for-wp')); ?>
</form>
</div>
<?php require MC4WP_PLUGIN_DIR . '/includes/views/parts/admin-footer.php'; ?>
</div>
<div class="mc4wp-sidebar mc4wp-col">
<?php require MC4WP_PLUGIN_DIR . '/includes/views/parts/admin-sidebar.php'; ?>
</div>
</div>
</div>

View File

@@ -1,119 +1,105 @@
<?php defined( 'ABSPATH' ) or exit;
<?php defined('ABSPATH') or exit;
$tabs = array(
'fields' => esc_html__( 'Fields', 'mailchimp-for-wp' ),
'messages' => esc_html__( 'Messages', 'mailchimp-for-wp' ),
'settings' => esc_html__( 'Settings', 'mailchimp-for-wp' ),
'appearance' => esc_html__( 'Appearance', 'mailchimp-for-wp' ),
);
$tabs = [
'fields' => esc_html__('Fields', 'mailchimp-for-wp'),
'messages' => esc_html__('Messages', 'mailchimp-for-wp'),
'settings' => esc_html__('Settings', 'mailchimp-for-wp'),
'appearance' => esc_html__('Appearance', 'mailchimp-for-wp'),
];
/**
* Filters the setting tabs on the "edit form" screen.
*
* @param array $tabs
* @ignore
*/
$tabs = apply_filters( 'mc4wp_admin_edit_form_tabs', $tabs );
$tabs = apply_filters('mc4wp_admin_edit_form_tabs', $tabs);
?>
<div id="mc4wp-admin" class="wrap mc4wp-settings">
<p class="mc4wp-breadcrumbs">
<span class="prefix"><?php echo esc_html__( 'You are here: ', 'mailchimp-for-wp' ); ?></span>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=mailchimp-for-wp' ) ); ?>">Mailchimp for WordPress</a> &rsaquo;
<a href="<?php echo esc_url( admin_url( 'admin.php?page=mailchimp-for-wp-forms' ) ); ?>"><?php echo esc_html__( 'Forms', 'mailchimp-for-wp' ); ?></a>
&rsaquo;
<span class="current-crumb"><strong><?php echo esc_html__( 'Form', 'mailchimp-for-wp' ); ?> <?php echo $form_id; ?>
| <?php echo esc_html( $form->name ); ?></strong></span>
</p>
<p class="mc4wp-breadcrumbs">
<span class="prefix"><?php echo esc_html__('You are here: ', 'mailchimp-for-wp'); ?></span>
<a href="<?php echo esc_url(admin_url('admin.php?page=mailchimp-for-wp')); ?>">Mailchimp for WordPress</a> &rsaquo;
<a href="<?php echo esc_url(admin_url('admin.php?page=mailchimp-for-wp-forms')); ?>"><?php echo esc_html__('Forms', 'mailchimp-for-wp'); ?></a>
&rsaquo;
<span class="current-crumb"><strong><?php echo esc_html__('Form', 'mailchimp-for-wp'); ?> <?php echo esc_html($form_id); ?>
| <?php echo esc_html($form->name); ?></strong></span>
</p>
<!-- Main Content -->
<div>
<div>
<h1 class="mc4wp-page-title">
<?php echo esc_html__('Edit Form', 'mailchimp-for-wp'); ?>
<h1 class="mc4wp-page-title">
<?php echo esc_html__( 'Edit Form', 'mailchimp-for-wp' ); ?>
<?php do_action('mc4wp_admin_edit_form_after_title'); ?>
</h1>
<!-- Form actions -->
<?php
<?php // fake h2 for admin notices ?>
<h2 style="display: none;"></h2>
/**
* @ignore
*/
do_action( 'mc4wp_admin_edit_form_after_title' );
?>
</h1>
<?php // wrap entire page in <form> element ?>
<form method="post">
<?php // default submit button to prevent opening preview ?>
<input type="submit" style="display: none;" />
<input type="hidden" name="_mc4wp_action" value="edit_form"/>
<?php wp_nonce_field('_mc4wp_action', '_wpnonce'); ?>
<input type="hidden" name="mc4wp_form_id" value="<?php echo esc_attr($form->ID); ?>"/>
<h2 style="display: none;"></h2><?php // fake h2 for admin notices ?>
<!-- Wrap entire page in <form> -->
<form method="post">
<?php // default submit button to prevent opening preview ?>
<input type="submit" style="display: none;" />
<input type="hidden" name="_mc4wp_action" value="edit_form"/>
<?php wp_nonce_field( '_mc4wp_action', '_wpnonce' ); ?>
<input type="hidden" name="mc4wp_form_id" value="<?php echo esc_attr( $form->ID ); ?>"/>
<div id="titlediv" class="mc4wp-margin-s">
<div id="titlewrap">
<label class="screen-reader-text"
for="title"><?php echo esc_html__( 'Enter form title here', 'mailchimp-for-wp' ); ?></label>
<input type="text" name="mc4wp_form[name]" size="30"
value="<?php echo esc_attr( $form->name ); ?>" id="title" spellcheck="true"
autocomplete="off"
placeholder="<?php echo esc_html__( 'Enter the title of your sign-up form', 'mailchimp-for-wp' ); ?>"
style="line-height: initial;">
</div>
<div>
<?php echo sprintf( esc_html__( 'Use the shortcode %s to display this form inside a post, page or text widget.', 'mailchimp-for-wp' ), '<input type="text" onfocus="this.select();" readonly="readonly" value="' . esc_attr( sprintf( '[mc4wp_form id=%d]', $form->ID ) ) . '" size="' . ( strlen( $form->ID ) + 15 ) . '">' ); ?>
</div>
</div>
<div id="titlediv" class="mc4wp-margin-s">
<div id="titlewrap">
<label class="screen-reader-text"
for="title"><?php echo esc_html__('Enter form title here', 'mailchimp-for-wp'); ?></label>
<input type="text" name="mc4wp_form[name]" size="30"
value="<?php echo esc_attr($form->name); ?>" id="title" spellcheck="true"
autocomplete="off"
placeholder="<?php echo esc_html__('Enter the title of your sign-up form', 'mailchimp-for-wp'); ?>"
style="line-height: initial;">
</div>
<div>
<?php echo sprintf(esc_html__('Use the shortcode %s to display this form inside a post, page or text widget.', 'mailchimp-for-wp'), '<input type="text" onfocus="this.select();" readonly="readonly" value="' . esc_attr(sprintf('[mc4wp_form id=%d]', $form->ID)) . '" size="' . ( strlen($form->ID) + 15 ) . '">'); ?>
</div>
</div>
<div>
<h2 class="nav-tab-wrapper" id="mc4wp-tabs-nav">
<?php
foreach ( $tabs as $tab => $name ) {
$class = ( $active_tab === $tab ) ? 'nav-tab-active' : '';
echo sprintf( '<a class="nav-tab nav-tab-%s %s" data-tab="%s" href="%s">%s</a>', $tab, $class, $tab, esc_attr( $this->tab_url( $tab ) ), $name );
}
?>
</h2>
<div>
<h2 class="nav-tab-wrapper" id="mc4wp-tabs-nav">
<?php
foreach ($tabs as $tab => $name) {
$class = ( $active_tab === $tab ) ? 'nav-tab-active' : '';
$href = esc_attr($this->tab_url($tab));
echo "<a class=\"nav-tab nav-tab-{$tab} {$class}\" data-tab=\"{$tab}\" href=\"{$href}\">{$name}</a>";
}
?>
</h2>
<div id="mc4wp-tabs">
<div id="mc4wp-tabs">
<?php
<?php
foreach ($tabs as $tab => $name) {
$class = ( $active_tab === $tab ) ? 'mc4wp-tab-active' : '';
echo "<div class=\"mc4wp-tab {$class}\" id=\"mc4wp-tab-{$tab}\">";
foreach ( $tabs as $tab => $name ) :
$class = ( $active_tab === $tab ) ? 'mc4wp-tab-active' : '';
/**
* Runs when outputting a tab section on the "edit form" screen
*
* @param array $opts
* @param MC4WP_Form $form
*/
do_action('mc4wp_admin_edit_form_output_' . $tab . '_tab', $opts, $form);
// start of .tab
echo sprintf( '<div class="mc4wp-tab %s" id="mc4wp-tab-%s">', $class, $tab );
$tab_file = __DIR__ . '/tabs/form-' . $tab . '.php';
if (file_exists($tab_file)) {
include $tab_file;
}
/**
* Runs when outputting a tab section on the "edit form" screen
*
* @param string $tab
* @ignore
*/
do_action( 'mc4wp_admin_edit_form_output_' . $tab . '_tab', $opts, $form );
// end of .tab
echo '</div>';
} // foreach tabs
?>
$tab_file = __DIR__ . '/tabs/form-' . $tab . '.php';
if ( file_exists( $tab_file ) ) {
include $tab_file;
}
</div>
</div>
</form>
// end of .tab
echo '</div>';
endforeach; // foreach tabs
?>
</div><!-- / tabs -->
</div>
</form><!-- Entire page form wrap -->
<?php require MC4WP_PLUGIN_DIR . '/includes/views/parts/admin-footer.php'; ?>
</div>
<?php include MC4WP_PLUGIN_DIR . '/includes/views/parts/admin-footer.php'; ?>
</div>
</div>

View File

@@ -1,66 +1,66 @@
<?php defined( 'ABSPATH' ) or exit; ?>
<?php defined('ABSPATH') or exit; ?>
<div class="mc4wp-admin">
<h2><?php echo esc_html__( 'Add more fields', 'mailchimp-for-wp' ); ?></h2>
<h2><?php echo esc_html__('Add more fields', 'mailchimp-for-wp'); ?></h2>
<div>
<div>
<p>
<?php echo esc_html__( 'To add more fields to your form, you will need to create those fields in Mailchimp first.', 'mailchimp-for-wp' ); ?>
</p>
<p>
<?php echo esc_html__('To add more fields to your form, you will need to create those fields in Mailchimp first.', 'mailchimp-for-wp'); ?>
</p>
<p><strong><?php echo esc_html__( "Here's how:", 'mailchimp-for-wp' ); ?></strong></p>
<p><strong><?php echo esc_html__("Here's how:", 'mailchimp-for-wp'); ?></strong></p>
<ol>
<li>
<p>
<?php echo esc_html__( 'Log in to your Mailchimp account.', 'mailchimp-for-wp' ); ?>
</p>
</li>
<li>
<p>
<?php echo esc_html__( 'Add list fields to any of your selected lists.', 'mailchimp-for-wp' ); ?>
<?php echo esc_html__( 'Clicking the following links will take you to the right screen.', 'mailchimp-for-wp' ); ?>
</p>
<ul class="children lists--only-selected">
<?php
foreach ( $lists as $list ) {
?>
<li data-list-id="<?php echo $list->id; ?>" style="display: <?php echo in_array( $list->id, $opts['lists'] ) ? '' : 'none'; ?>">
<a href="https://admin.mailchimp.com/lists/settings/merge-tags?id=<?php echo $list->web_id; ?>">
<span class="screen-reader-text"><?php echo esc_html__( 'Edit list fields for', 'mailchimp-for-wp' ); ?> </span>
<?php echo $list->name; ?>
</a>
</li>
<?php
}
?>
</ul>
</li>
<li>
<p>
<?php echo esc_html__( 'Click the following button to have Mailchimp for WordPress pick up on your changes.', 'mailchimp-for-wp' ); ?>
</p>
<ol>
<li>
<p>
<?php echo esc_html__('Log in to your Mailchimp account.', 'mailchimp-for-wp'); ?>
</p>
</li>
<li>
<p>
<?php echo esc_html__('Add list fields to any of your selected lists.', 'mailchimp-for-wp'); ?>
<?php echo esc_html__('Clicking the following links will take you to the right screen.', 'mailchimp-for-wp'); ?>
</p>
<ul class="children lists--only-selected">
<?php
foreach ($lists as $list) {
?>
<li data-list-id="<?php echo $list->id; ?>" style="display: <?php echo in_array($list->id, $opts['lists']) ? '' : 'none'; ?>">
<a href="https://admin.mailchimp.com/lists/settings/merge-tags?id=<?php echo $list->web_id; ?>">
<span class="screen-reader-text"><?php echo esc_html__('Edit list fields for', 'mailchimp-for-wp'); ?> </span>
<?php echo $list->name; ?>
</a>
</li>
<?php
}
?>
</ul>
</li>
<li>
<p>
<?php echo esc_html__('Click the following button to have Mailchimp for WordPress pick up on your changes.', 'mailchimp-for-wp'); ?>
</p>
<p>
<a class="button button-primary" href="
<?php
echo esc_attr(
add_query_arg(
array(
'_mc4wp_action' => 'empty_lists_cache',
'_wpnonce' => wp_create_nonce( '_mc4wp_action' ),
)
)
);
?>
">
<?php echo esc_html__( 'Renew Mailchimp lists', 'mailchimp-for-wp' ); ?>
</a>
</p>
</li>
</ol>
<p>
<a class="button button-primary" href="
<?php
echo esc_attr(
add_query_arg(
[
'_mc4wp_action' => 'empty_lists_cache',
'_wpnonce' => wp_create_nonce('_mc4wp_action'),
]
)
);
?>
">
<?php echo esc_html__('Renew Mailchimp audiences', 'mailchimp-for-wp'); ?>
</a>
</p>
</li>
</ol>
</div>
</div>
</div>

View File

@@ -1,24 +1,24 @@
<?php
defined( 'ABSPATH' ) or exit;
defined('ABSPATH') or exit;
$tags = mc4wp( 'forms' )->get_tags();
$tags = mc4wp('forms')->get_tags();
?>
<h2><?php echo esc_html__( 'Add dynamic form variable', 'mailchimp-for-wp' ); ?></h2>
<h2><?php echo esc_html__('Add dynamic form variable', 'mailchimp-for-wp'); ?></h2>
<p>
<?php echo sprintf( wp_kses( __( 'The following list of variables can be used to <a href="%s">add some dynamic content to your form or success and error messages</a>.', 'mailchimp-for-wp' ), array( 'a' => array( 'href' => array() ) ) ), 'https://www.mc4wp.com/kb/using-variables-in-your-form-or-messages/' ) . ' ' . __( 'This allows you to personalise your form or response messages.', 'mailchimp-for-wp' ); ?>
<?php echo sprintf(wp_kses(__('The following list of variables can be used to <a href="%s">add some dynamic content to your form or success and error messages</a>.', 'mailchimp-for-wp'), [ 'a' => [ 'href' => [] ] ]), 'https://www.mc4wp.com/kb/using-variables-in-your-form-or-messages/') . ' ' . __('This allows you to personalise your form or response messages.', 'mailchimp-for-wp'); ?>
</p>
<table class="widefat striped">
<?php
foreach ( $tags as $tag => $config ) {
$tag = ! empty( $config['example'] ) ? $config['example'] : $tag;
?>
<tr>
<td>
<input type="text" class="widefat" value="<?php echo esc_attr( sprintf( '{%s}', $tag ) ); ?>" readonly="readonly" onfocus="this.select();" />
<p class="description" style="margin-bottom:0;"><?php echo strip_tags( $config['description'], '<strong><b><em><i><a><code>' ); ?></p>
</td>
</tr>
<?php
}
?>
<?php
foreach ($tags as $tag => $config) {
$tag = ! empty($config['example']) ? $config['example'] : $tag;
?>
<tr>
<td>
<input type="text" class="widefat" value="<?php echo esc_attr(sprintf('{%s}', $tag)); ?>" readonly="readonly" onfocus="this.select();" />
<p class="description" style="margin-bottom:0;"><?php echo strip_tags($config['description'], '<strong><b><em><i><a><code>'); ?></p>
</td>
</tr>
<?php
}
?>
</table>

View File

@@ -1,53 +1,51 @@
<?php
defined( 'ABSPATH' ) or exit;
defined('ABSPATH') or exit;
// fake post to prevent notices in wp_enqueue_scripts call
$GLOBALS['post'] = new \WP_Post( (object) array( 'filter' => 'raw' ) );
$GLOBALS['post'] = new \WP_Post((object) [ 'filter' => 'raw' ]);
$GLOBALS['wp_query'] = new \WP_Query();
// render simple page with form in it.
?><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link type="text/css" rel="stylesheet" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<?php
wp_enqueue_scripts();
wp_print_styles();
wp_print_head_scripts();
if ( function_exists( 'wp_custom_css_cb' ) ) {
wp_custom_css_cb();
}
?>
<style type="text/css">
body{
background: white;
width: 100%;
max-width: 100%;
text-align: left;
}
/* hide all other elements */
body::before,
body::after,
body > *:not(#form-preview) {
display:none !important;
}
#form-preview {
display: block !important;
width: 100%;
height: 100%;
padding: 20px;
border: 0;
margin: 0;
}
</style>
<title>Mailchimp for WordPress Form Preview</title>
<meta charset="utf-8">
<meta name="robots" content="noindex">
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
<?php
wp_head();
?>
<style>
html,
body{
background: white;
width: 100%;
text-align: left;
}
<?php // hide all other elements except the form preview ?>
html::before,
html::after,
body::before,
body::after,
body > *:not(#form-preview) {
display:none !important;
}
#form-preview {
display: block !important;
width: 100%;
height: 100%;
padding: 20px;
border: 0;
margin: 0;
box-sizing: border-box;
}
</style>
</head>
<body class="page-template-default page ">
<div id="form-preview" class="page type-page status-publish hentry post post-content">
<?php mc4wp_show_form( $form_id ); ?>
</div>
<?php wp_footer(); ?>
<body class="page-template-default page">
<div id="form-preview" class="page type-page status-publish hentry post post-content">
<?php mc4wp_show_form($form_id); ?>
</div>
<?php wp_footer(); ?>
</body>
</html>

View File

@@ -1,61 +1,56 @@
<?php
$theme = wp_get_theme();
$css_options = array(
'0' => sprintf( esc_html__( 'Inherit from %s theme', 'mailchimp-for-wp' ), $theme->Name ),
'basic' => esc_html__( 'Basic', 'mailchimp-for-wp' ),
esc_html__( 'Form Themes', 'mailchimp-for-wp' ) => array(
'theme-light' => esc_html__( 'Light Theme', 'mailchimp-for-wp' ),
'theme-dark' => esc_html__( 'Dark Theme', 'mailchimp-for-wp' ),
'theme-red' => esc_html__( 'Red Theme', 'mailchimp-for-wp' ),
'theme-green' => esc_html__( 'Green Theme', 'mailchimp-for-wp' ),
'theme-blue' => esc_html__( 'Blue Theme', 'mailchimp-for-wp' ),
),
);
$css_options = [
'0' => sprintf(esc_html__('Inherit from %s theme', 'mailchimp-for-wp'), $theme->Name), // @phpstan-ignore-line WP_Theme::$name is a dynamic property
'basic' => esc_html__('Basic', 'mailchimp-for-wp'),
esc_html__('Form Themes', 'mailchimp-for-wp') => [
'theme-light' => esc_html__('Light Theme', 'mailchimp-for-wp'),
'theme-dark' => esc_html__('Dark Theme', 'mailchimp-for-wp'),
'theme-red' => esc_html__('Red Theme', 'mailchimp-for-wp'),
'theme-green' => esc_html__('Green Theme', 'mailchimp-for-wp'),
'theme-blue' => esc_html__('Blue Theme', 'mailchimp-for-wp'),
],
];
/**
* Filters the <option>'s in the "CSS Stylesheet" <select> box.
*
* @ignore
*/
$css_options = apply_filters( 'mc4wp_admin_form_css_options', $css_options );
$css_options = apply_filters('mc4wp_admin_form_css_options', $css_options);
?>
<h2><?php echo esc_html__( 'Form Appearance', 'mailchimp-for-wp' ); ?></h2>
<h2><?php echo esc_html__('Form Appearance', 'mailchimp-for-wp'); ?></h2>
<table class="form-table">
<tr valign="top">
<th scope="row"><label for="mc4wp_load_stylesheet_select"><?php echo esc_html__( 'Form Style', 'mailchimp-for-wp' ); ?></label></th>
<td class="nowrap valigntop">
<select name="mc4wp_form[settings][css]" id="mc4wp_load_stylesheet_select">
<tr valign="top">
<th scope="row"><label for="mc4wp_load_stylesheet_select"><?php echo esc_html__('Form Style', 'mailchimp-for-wp'); ?></label></th>
<td class="nowrap valigntop">
<select name="mc4wp_form[settings][css]" id="mc4wp_load_stylesheet_select">
<?php
foreach ( $css_options as $key => $option ) {
if ( is_array( $option ) ) {
$label = $key;
$options = $option;
printf( '<optgroup label="%s">', $label );
foreach ( $options as $key => $option ) {
printf( '<option value="%s" %s>%s</option>', $key, selected( $opts['css'], $key, false ), $option );
}
print( '</optgroup>' );
} else {
printf( '<option value="%s" %s>%s</option>', $key, selected( $opts['css'], $key, false ), $option );
}
}
?>
</select>
<p class="description">
<?php echo esc_html__( 'If you want to load some default CSS styles, select "basic formatting styles" or choose one of the color themes', 'mailchimp-for-wp' ); ?>
</p>
</td>
</tr>
<?php
foreach ($css_options as $key => $option) {
if (is_array($option)) {
$label = $key;
$options = $option;
printf('<optgroup label="%s">', $label);
foreach ($options as $key => $option) {
printf('<option value="%s" %s>%s</option>', $key, selected($opts['css'], $key, false), $option);
}
print( '</optgroup>' );
} else {
printf('<option value="%s" %s>%s</option>', $key, selected($opts['css'], $key, false), $option);
}
}
?>
</select>
<p class="description">
<?php echo esc_html__('If you want to load some default CSS styles, select "basic formatting styles" or choose one of the color themes', 'mailchimp-for-wp'); ?>
</p>
</td>
</tr>
<?php
/** @ignore */
do_action( 'mc4wp_admin_form_after_appearance_settings_rows', $opts, $form );
?>
<?php do_action('mc4wp_admin_form_after_appearance_settings_rows', $opts, $form); ?>
</table>

View File

@@ -1,49 +1,49 @@
<?php add_thickbox(); ?>
<div class="alignright">
<a href="#TB_inline?width=0&height=550&inlineId=mc4wp-form-variables" class="thickbox button-secondary">
<span class="dashicons dashicons-info"></span>
<?php echo esc_html__( 'Form variables', 'mailchimp-for-wp' ); ?>
</a>
<a href="#TB_inline?width=600&height=400&inlineId=mc4wp-add-field-help" class="thickbox button-secondary">
<span class="dashicons dashicons-editor-help"></span>
<?php echo esc_html__( 'Add more fields', 'mailchimp-for-wp' ); ?>
</a>
<a href="#TB_inline?width=0&height=550&inlineId=mc4wp-form-variables" class="thickbox button-secondary">
<span class="dashicons dashicons-info"></span>
<?php echo esc_html__('Form variables', 'mailchimp-for-wp'); ?>
</a>
<a href="#TB_inline?width=600&height=400&inlineId=mc4wp-add-field-help" class="thickbox button-secondary">
<span class="dashicons dashicons-editor-help"></span>
<?php echo esc_html__('Add more fields', 'mailchimp-for-wp'); ?>
</a>
</div>
<h2><?php echo esc_html__( 'Form Fields', 'mailchimp-for-wp' ); ?></h2>
<h2><?php echo esc_html__('Form Fields', 'mailchimp-for-wp'); ?></h2>
<!-- Placeholder for the field wizard -->
<div id="mc4wp-field-wizard"></div>
<div class="mc4wp-form-markup-wrap">
<div class="mc4wp-form-editor-wrap">
<h4 style="margin: 0"><?php echo esc_html__( 'Form code', 'mailchimp-for-wp' ); ?> <span style="visibility: hidden;" class="dashicons dashicons-editor-help"></span></h4>
<!-- Textarea for the actual form content HTML -->
<textarea class="widefat" cols="160" rows="20" id="mc4wp-form-content" name="mc4wp_form[content]" placeholder="<?php echo esc_attr__( 'Enter the HTML code for your form fields..', 'mailchimp-for-wp' ); ?>" autocomplete="false" autocorrect="false" autocapitalize="false" spellcheck="false"><?php echo htmlspecialchars( $form->content, ENT_QUOTES, get_option( 'blog_charset' ) ); ?></textarea>
</div>
<div class="mc4wp-form-preview-wrap">
<h4 style="margin: 0;">
<?php echo esc_html__( 'Form preview', 'mailchimp-for-wp' ); ?>
<span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__( 'The form may look slightly different than this when shown in a post, page or widget area.', 'mailchimp-for-wp' ); ?>"></span>
</h4>
<iframe id="mc4wp-form-preview" src="<?php echo esc_attr( $form_preview_url ); ?>"></iframe>
</div>
<div class="mc4wp-form-editor-wrap">
<h4 style="margin: 0"><?php echo esc_html__('Form code', 'mailchimp-for-wp'); ?> <span style="visibility: hidden;" class="dashicons dashicons-editor-help"></span></h4>
<!-- Textarea for the actual form content HTML -->
<textarea class="widefat" cols="160" rows="20" id="mc4wp-form-content" name="mc4wp_form[content]" placeholder="<?php echo esc_attr__('Enter the HTML code for your form fields..', 'mailchimp-for-wp'); ?>" autocomplete="false" autocorrect="false" autocapitalize="false" spellcheck="false"><?php echo htmlspecialchars($form->content, ENT_QUOTES, get_option('blog_charset')); ?></textarea>
</div>
<div class="mc4wp-form-preview-wrap">
<h4 style="margin: 0;">
<?php echo esc_html__('Form preview', 'mailchimp-for-wp'); ?>
<span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('The form may look slightly different than this when shown in a post, page or widget area.', 'mailchimp-for-wp'); ?>"></span>
</h4>
<iframe id="mc4wp-form-preview" src="<?php echo esc_attr($form_preview_url); ?>"></iframe>
</div>
</div>
<!-- This field is updated by JavaScript as the form content changes -->
<input type="hidden" id="required-fields" name="mc4wp_form[settings][required_fields]" value="<?php echo esc_attr( $form->settings['required_fields'] ); ?>" />
<input type="hidden" id="required-fields" name="mc4wp_form[settings][required_fields]" value="<?php echo esc_attr($form->settings['required_fields']); ?>" />
<?php submit_button(); ?>
<p class="mc4wp-form-usage"><?php printf( esc_html__( 'Use the shortcode %s to display this form inside a post, page or text widget.', 'mailchimp-for-wp' ), '<input type="text" onfocus="this.select();" readonly="readonly" value="' . esc_attr( sprintf( '[mc4wp_form id=%d]', $form->ID ) ) . '" size="' . ( strlen( $form->ID ) + 15 ) . '">' ); ?></p>
<p class="mc4wp-form-usage"><?php printf(esc_html__('Use the shortcode %s to display this form inside a post, page or text widget.', 'mailchimp-for-wp'), '<input type="text" onfocus="this.select();" readonly="readonly" value="' . esc_attr(sprintf('[mc4wp_form id=%d]', $form->ID)) . '" size="' . ( strlen($form->ID) + 15 ) . '">'); ?></p>
<?php // Content for Thickboxes ?>
<div id="mc4wp-form-variables" style="display: none;">
<?php require __DIR__ . '/../parts/dynamic-content-tags.php'; ?>
<?php require __DIR__ . '/../parts/dynamic-content-tags.php'; ?>
</div>
<div id="mc4wp-add-field-help" style="display: none;">
<?php require __DIR__ . '/../parts/add-fields-help.php'; ?>
<?php require __DIR__ . '/../parts/add-fields-help.php'; ?>
</div>

View File

@@ -1,99 +1,101 @@
<?php defined( 'ABSPATH' ) or exit;
<?php defined('ABSPATH') or exit;
/** @var MC4WP_Form $form */
?>
<h2><?php echo esc_html__( 'Form Messages', 'mailchimp-for-wp' ); ?></h2>
<h2><?php echo esc_html__('Form Messages', 'mailchimp-for-wp'); ?></h2>
<table class="form-table mc4wp-form-messages">
<?php
/** @ignore */
do_action( 'mc4wp_admin_form_before_messages_settings_rows', $opts, $form );
?>
<?php do_action('mc4wp_admin_form_before_messages_settings_rows', $opts, $form); ?>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_subscribed"><?php echo esc_html__( 'Successfully subscribed', 'mailchimp-for-wp' ); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_subscribed" name="mc4wp_form[messages][subscribed]" value="<?php echo esc_attr( $form->messages['subscribed'] ); ?>" />
<p class="description"><?php echo esc_html__( 'The text that shows when an email address is successfully subscribed to the selected list(s).', 'mailchimp-for-wp' ); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_invalid_email"><?php echo esc_html__( 'Invalid email address', 'mailchimp-for-wp' ); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_invalid_email" name="mc4wp_form[messages][invalid_email]" value="<?php echo esc_attr( $form->messages['invalid_email'] ); ?>" required />
<p class="description"><?php echo esc_html__( 'The text that shows when an invalid email address is given.', 'mailchimp-for-wp' ); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_required_field_missing"><?php echo esc_html__( 'Required field missing', 'mailchimp-for-wp' ); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_required_field_missing" name="mc4wp_form[messages][required_field_missing]" value="<?php echo esc_attr( $form->messages['required_field_missing'] ); ?>" required />
<p class="description"><?php echo esc_html__( 'The text that shows when a required field for the selected list(s) is missing.', 'mailchimp-for-wp' ); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_already_subscribed"><?php echo esc_html__( 'Already subscribed', 'mailchimp-for-wp' ); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_already_subscribed" name="mc4wp_form[messages][already_subscribed]" value="<?php echo esc_attr( $form->messages['already_subscribed'] ); ?>" required />
<p class="description"><?php echo esc_html__( 'The text that shows when the given email is already subscribed to the selected list(s).', 'mailchimp-for-wp' ); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_error"><?php echo esc_html__( 'General error', 'mailchimp-for-wp' ); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_error" name="mc4wp_form[messages][error]" value="<?php echo esc_attr( $form->messages['error'] ); ?>" required />
<p class="description"><?php echo esc_html__( 'The text that shows when a general error occured.', 'mailchimp-for-wp' ); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_unsubscribed"><?php echo esc_html__( 'Unsubscribed', 'mailchimp-for-wp' ); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_unsubscribed" name="mc4wp_form[messages][unsubscribed]" value="<?php echo esc_attr( $form->messages['unsubscribed'] ); ?>" required />
<p class="description"><?php echo esc_html__( 'When using the unsubscribe method, this is the text that shows when the given email address is successfully unsubscribed from the selected list(s).', 'mailchimp-for-wp' ); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_not_subscribed"><?php echo esc_html__( 'Not subscribed', 'mailchimp-for-wp' ); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_not_subscribed" name="mc4wp_form[messages][not_subscribed]" value="<?php echo esc_attr( $form->messages['not_subscribed'] ); ?>" required />
<p class="description"><?php echo esc_html__( 'When using the unsubscribe method, this is the text that shows when the given email address is not on the selected list(s).', 'mailchimp-for-wp' ); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_no_lists_selected"><?php echo esc_html__( 'No list selected', 'mailchimp-for-wp' ); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_no_lists_selected" name="mc4wp_form[messages][no_lists_selected]" value="<?php echo esc_attr( $form->messages['no_lists_selected'] ); ?>" required />
<p class="description"><?php echo esc_html__( 'When offering a list choice, this is the text that shows when no lists were selected.', 'mailchimp-for-wp' ); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_subscribed"><?php echo esc_html__('Successfully subscribed', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_subscribed" name="mc4wp_form[messages][subscribed]" value="<?php echo esc_attr($form->messages['subscribed']); ?>" />
<p class="description"><?php echo esc_html__('The text that shows when an email address is successfully subscribed to the selected Mailchimp audiences.', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_invalid_email"><?php echo esc_html__('Invalid email address', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_invalid_email" name="mc4wp_form[messages][invalid_email]" value="<?php echo esc_attr($form->messages['invalid_email']); ?>" required />
<p class="description"><?php echo esc_html__('The text that shows when an invalid email address is given.', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_required_field_missing"><?php echo esc_html__('Required field missing', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_required_field_missing" name="mc4wp_form[messages][required_field_missing]" value="<?php echo esc_attr($form->messages['required_field_missing']); ?>" required />
<p class="description"><?php echo esc_html__('The text that shows when a required field for the selected Mailchimp audiences is missing.', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_already_subscribed"><?php echo esc_html__('Already subscribed', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_already_subscribed" name="mc4wp_form[messages][already_subscribed]" value="<?php echo esc_attr($form->messages['already_subscribed']); ?>" required />
<p class="description"><?php echo esc_html__('The text that shows when the given email is already subscribed to the selected Mailchimp audiences.', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_error"><?php echo esc_html__('General error', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_error" name="mc4wp_form[messages][error]" value="<?php echo esc_attr($form->messages['error']); ?>" required />
<p class="description"><?php echo esc_html__('The text that shows when a general error occured.', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_unsubscribed"><?php echo esc_html__('Unsubscribed', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_unsubscribed" name="mc4wp_form[messages][unsubscribed]" value="<?php echo esc_attr($form->messages['unsubscribed']); ?>" required />
<p class="description"><?php echo esc_html__('When using the unsubscribe method, this is the text that shows when the given email address is successfully unsubscribed from the selected Mailchimp audiences).', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_not_subscribed"><?php echo esc_html__('Not subscribed', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_not_subscribed" name="mc4wp_form[messages][not_subscribed]" value="<?php echo esc_attr($form->messages['not_subscribed']); ?>" required />
<p class="description"><?php echo esc_html__('When using the unsubscribe method, this is the text that shows when the given email address is not on the selected Mailchimp audiences.', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_no_lists_selected"><?php echo esc_html__('No Mailchimp audiences selected', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_no_lists_selected" name="mc4wp_form[messages][no_lists_selected]" value="<?php echo esc_attr($form->messages['no_lists_selected']); ?>" required />
<p class="description"><?php echo esc_html__('When offering an audience choice, this is the text that shows when no Mailchimp audiences were selected.', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<?php
$config = array(
'element' => 'mc4wp_form[settings][update_existing]',
'value' => 1,
);
?>
<tr valign="top" data-showif="<?php echo esc_attr( json_encode( $config ) ); ?>">
<th scope="row"><label for="mc4wp_form_updated"><?php echo esc_html__( 'Updated', 'mailchimp-for-wp' ); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_updated" name="mc4wp_form[messages][updated]" value="<?php echo esc_attr( $form->messages['updated'] ); ?>" />
<p class="description"><?php echo esc_html__( 'The text that shows when an existing subscriber is updated.', 'mailchimp-for-wp' ); ?></p>
</td>
</tr>
<?php
$config = [
'element' => 'mc4wp_form[settings][update_existing]',
'value' => 1,
];
?>
<tr valign="top" data-showif="<?php echo esc_attr(json_encode($config)); ?>">
<th scope="row"><label for="mc4wp_form_updated"><?php echo esc_html__('Updated', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_updated" name="mc4wp_form[messages][updated]" value="<?php echo esc_attr($form->messages['updated']); ?>" />
<p class="description"><?php echo esc_html__('The text that shows when an existing subscriber is updated.', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<?php
/** @ignore */
do_action( 'mc4wp_admin_form_after_messages_settings_rows', array(), $form );
?>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_message_spam"><?php echo esc_html__('Spam', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_message_spam" name="mc4wp_form[messages][spam]" value="<?php echo esc_attr($form->messages['spam']); ?>" />
<p class="description"><?php echo esc_html__('The text that shows when a submission is marked as spam.', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<tr valign="top">
<th></th>
<td>
<p class="description"><?php echo sprintf( esc_html__( 'HTML tags like %s are allowed in the message fields.', 'mailchimp-for-wp' ), '<code>' . esc_html( '<strong><em><a>' ) . '</code>' ); ?></p>
</td>
</tr>
<?php do_action('mc4wp_admin_form_after_messages_settings_rows', [], $form); ?>
<tr valign="top">
<th></th>
<td>
<p class="description"><?php echo sprintf(esc_html__('HTML tags like %s are allowed in the message fields.', 'mailchimp-for-wp'), '<code>' . esc_html('<strong><em><a>') . '</code>'); ?></p>
</td>
</tr>
</table>

View File

@@ -1,166 +1,181 @@
<h2><?php echo esc_html__( 'Form Settings', 'mailchimp-for-wp' ); ?></h2>
<h2><?php echo esc_html__('Form Settings', 'mailchimp-for-wp'); ?></h2>
<div class="mc4wp-margin-m"></div>
<h3><?php echo esc_html__( 'Mailchimp specific settings', 'mailchimp-for-wp' ); ?></h3>
<h3><?php echo esc_html__('Mailchimp specific settings', 'mailchimp-for-wp'); ?></h3>
<table class="form-table" style="table-layout: fixed;">
<?php
/** @ignore */
do_action( 'mc4wp_admin_form_before_mailchimp_settings_rows', $opts, $form );
?>
<?php do_action('mc4wp_admin_form_before_mailchimp_settings_rows', $opts, $form); ?>
<tr valign="top">
<th scope="row" style="width: 250px;"><?php echo esc_html__( 'Lists this form subscribes to', 'mailchimp-for-wp' ); ?></th>
<?php
// loop through lists
if ( empty( $lists ) ) {
?>
<td colspan="2"><?php echo sprintf( wp_kses( __( 'No lists found, <a href="%s">are you connected to Mailchimp</a>?', 'mailchimp-for-wp' ), array( 'a' => array( 'href' => array() ) ) ), admin_url( 'admin.php?page=mailchimp-for-wp' ) ); ?></td>
<?php
} else {
?>
<td >
<tr valign="top">
<th scope="row" style="width: 250px;"><?php echo esc_html__('Audiences this form subscribes to', 'mailchimp-for-wp'); ?></th>
<?php
// loop through lists
if (empty($lists)) {
?>
<td colspan="2"><?php echo sprintf(wp_kses(__('No audiences found, <a href="%s">are you connected to Mailchimp</a>?', 'mailchimp-for-wp'), [ 'a' => [ 'href' => [] ] ]), admin_url('admin.php?page=mailchimp-for-wp')); ?></td>
<?php
} else {
?>
<td >
<ul id="mc4wp-lists" style="margin-bottom: 20px; max-height: 300px; overflow-y: auto;">
<?php
foreach ( $lists as $list ) {
?>
<li>
<label>
<input class="mc4wp-list-input" type="checkbox" name="mc4wp_form[settings][lists][]" value="<?php echo esc_attr( $list->id ); ?>" <?php checked( in_array( $list->id, $opts['lists'] ), true ); ?>> <?php echo esc_html( $list->name ); ?>
</label>
</li>
<?php
}
?>
</ul>
<p class="description"><?php echo esc_html__( 'Select the list(s) to which people who submit this form should be subscribed.', 'mailchimp-for-wp' ); ?></p>
</td>
<?php
}
?>
<ul id="mc4wp-lists" style="margin-bottom: 20px; max-height: 300px; overflow-y: auto;">
<?php
foreach ($lists as $list) {
?>
<li>
<label>
<input class="mc4wp-list-input" type="checkbox" name="mc4wp_form[settings][lists][]" value="<?php echo esc_attr($list->id); ?>" <?php checked(in_array($list->id, $opts['lists']), true); ?>> <?php echo esc_html($list->name); ?>
</label>
</li>
<?php
}
?>
</ul>
<p class="description"><?php echo esc_html__('Select the Mailchimp audience to which people who submit this form should be subscribed.', 'mailchimp-for-wp'); ?></p>
</td>
<?php
}
?>
</tr>
<tr valign="top">
<th scope="row"><?php echo esc_html__( 'Use double opt-in?', 'mailchimp-for-wp' ); ?></th>
<td class="nowrap">
<label>
<input type="radio" name="mc4wp_form[settings][double_optin]" value="1" <?php checked( $opts['double_optin'], 1 ); ?> />&rlm;
<?php echo esc_html__( 'Yes', 'mailchimp-for-wp' ); ?>
</label> &nbsp;
<label>
<input type="radio" name="mc4wp_form[settings][double_optin]" value="0" <?php checked( $opts['double_optin'], 0 ); ?> onclick="return confirm('<?php echo esc_attr__( 'Are you sure you want to disable double opt-in?', 'mailchimp-for-wp' ); ?>');" />&rlm;
<?php echo esc_html__( 'No', 'mailchimp-for-wp' ); ?>
</label>
<p class="description"><?php echo esc_html__( 'We strongly suggest keeping double opt-in enabled. Disabling double opt-in may affect your GDPR compliance.', 'mailchimp-for-wp' ); ?></p>
</td>
</tr>
</tr>
<tr valign="top">
<th scope="row"><?php echo esc_html__('Use double opt-in?', 'mailchimp-for-wp'); ?></th>
<td class="nowrap">
<label>
<input type="radio" name="mc4wp_form[settings][double_optin]" value="1" <?php checked($opts['double_optin'], 1); ?> />&rlm;
<?php echo esc_html__('Yes', 'mailchimp-for-wp'); ?>
</label> &nbsp;
<label>
<input type="radio" name="mc4wp_form[settings][double_optin]" value="0" <?php checked($opts['double_optin'], 0); ?> onclick="return confirm('<?php echo esc_attr__('Are you sure you want to disable double opt-in?', 'mailchimp-for-wp'); ?>');" />&rlm;
<?php echo esc_html__('No', 'mailchimp-for-wp'); ?>
</label>
<p class="description"><?php echo esc_html__('We strongly suggest keeping double opt-in enabled. Disabling double opt-in may affect your GDPR compliance.', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php echo esc_html__( 'Update existing subscribers?', 'mailchimp-for-wp' ); ?></th>
<td class="nowrap">
<label>
<input type="radio" name="mc4wp_form[settings][update_existing]" value="1" <?php checked( $opts['update_existing'], 1 ); ?> />&rlm;
<?php echo esc_html__( 'Yes', 'mailchimp-for-wp' ); ?>
</label> &nbsp;
<label>
<input type="radio" name="mc4wp_form[settings][update_existing]" value="0" <?php checked( $opts['update_existing'], 0 ); ?> />&rlm;
<?php echo esc_html__( 'No', 'mailchimp-for-wp' ); ?>
</label>
<p class="description"><?php echo esc_html__( 'Select "yes" if you want to update existing subscribers with the data that is sent.', 'mailchimp-for-wp' ); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php echo esc_html__('Update existing subscribers?', 'mailchimp-for-wp'); ?></th>
<td class="nowrap">
<label>
<input type="radio" name="mc4wp_form[settings][update_existing]" value="1" <?php checked($opts['update_existing'], 1); ?> />&rlm;
<?php echo esc_html__('Yes', 'mailchimp-for-wp'); ?>
</label> &nbsp;
<label>
<input type="radio" name="mc4wp_form[settings][update_existing]" value="0" <?php checked($opts['update_existing'], 0); ?> />&rlm;
<?php echo esc_html__('No', 'mailchimp-for-wp'); ?>
</label>
<p class="description"><?php echo esc_html__('Select "yes" if you want to update existing subscribers with the data that is sent.', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<?php
$config = array(
'element' => 'mc4wp_form[settings][update_existing]',
'value' => 1,
);
?>
<tr valign="top" data-showif="<?php echo esc_attr( json_encode( $config ) ); ?>">
<th scope="row"><?php echo esc_html__( 'Replace interest groups?', 'mailchimp-for-wp' ); ?></th>
<td class="nowrap">
<label>
<input type="radio" name="mc4wp_form[settings][replace_interests]" value="1" <?php checked( $opts['replace_interests'], 1 ); ?> />&rlm;
<?php echo esc_html__( 'Yes', 'mailchimp-for-wp' ); ?>
</label> &nbsp;
<label>
<input type="radio" name="mc4wp_form[settings][replace_interests]" value="0" <?php checked( $opts['replace_interests'], 0 ); ?> />&rlm;
<?php echo esc_html__( 'No', 'mailchimp-for-wp' ); ?>
</label>
<p class="description">
<?php echo esc_html__( 'Select "no" if you want to add the selected interests to any previously selected interests when updating a subscriber.', 'mailchimp-for-wp' ); ?>
<?php echo sprintf( ' <a href="%s" target="_blank">' . esc_html__( 'What does this do?', 'mailchimp-for-wp' ) . '</a>', 'https://www.mc4wp.com/kb/what-does-replace-groupings-mean/#utm_source=wp-plugin&utm_medium=mailchimp-for-wp&utm_campaign=settings-page' ); ?>
</p>
</td>
</tr>
<?php
$config = [
'element' => 'mc4wp_form[settings][update_existing]',
'value' => 1,
];
?>
<tr valign="top" data-showif="<?php echo esc_attr(json_encode($config)); ?>">
<th scope="row"><?php echo esc_html__('Replace interest groups?', 'mailchimp-for-wp'); ?></th>
<td class="nowrap">
<label>
<input type="radio" name="mc4wp_form[settings][replace_interests]" value="1" <?php checked($opts['replace_interests'], 1); ?> />&rlm;
<?php echo esc_html__('Yes', 'mailchimp-for-wp'); ?>
</label> &nbsp;
<label>
<input type="radio" name="mc4wp_form[settings][replace_interests]" value="0" <?php checked($opts['replace_interests'], 0); ?> />&rlm;
<?php echo esc_html__('No', 'mailchimp-for-wp'); ?>
</label>
<p class="description">
<?php echo esc_html__('Select "no" if you want to add the selected interests to any previously selected interests when updating a subscriber.', 'mailchimp-for-wp'); ?>
<?php echo sprintf(' <a href="%s" target="_blank">' . esc_html__('What does this do?', 'mailchimp-for-wp') . '</a>', 'https://www.mc4wp.com/kb/what-does-replace-groupings-mean/#utm_source=wp-plugin&utm_medium=mailchimp-for-wp&utm_campaign=settings-page'); ?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_subscriber_tags"><?php echo esc_html__( 'Subscriber tags', 'mailchimp-for-wp' ); ?></label></th>
<td>
<input type="text" class="widefat" name="mc4wp_form[settings][subscriber_tags]" id="mc4wp_form_subscriber_tags" placeholder="<?php echo esc_attr__( 'Example: My tag, another tag', 'mailchimp-for-wp' ); ?>" value="<?php echo esc_attr( $opts['subscriber_tags'] ); ?>" />
<p class="description">
<?php echo esc_html__( 'The listed tags will be applied to all subscribers added or updated by this form.', 'mailchimp-for-wp' ); ?>
<?php echo esc_html__( 'Separate multiple values with a comma.', 'mailchimp-for-wp' ); ?>
</p>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_add_tags"><?php echo esc_html__('Add tags', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" name="mc4wp_form[settings][subscriber_tags]" id="mc4wp_form_add_tags" placeholder="<?php echo esc_attr__('Example: My tag, another tag', 'mailchimp-for-wp'); ?>" value="<?php echo esc_attr($opts['subscriber_tags']); ?>" />
<p class="description">
<?php echo esc_html__('The listed tags will be applied to all subscribers added or updated by this form.', 'mailchimp-for-wp'); ?>
<?php echo esc_html__('Separate multiple values with a comma.', 'mailchimp-for-wp'); ?>
</p>
</td>
</tr>
</td>
</tr>
<?php
/** @ignore */
do_action( 'mc4wp_admin_form_after_mailchimp_settings_rows', $opts, $form );
?>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_remove_tags"><?php echo esc_html__('Remove tags', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" name="mc4wp_form[settings][remove_subscriber_tags]" id="mc4wp_form_remove_tags" placeholder="<?php echo esc_attr__('Example: My tag, another tag', 'mailchimp-for-wp'); ?>" value="<?php echo esc_attr($opts['remove_subscriber_tags']); ?>" />
<p class="description">
<?php echo esc_html__('The listed tags will be removed from all subscribers updated by this form.', 'mailchimp-for-wp'); ?>
<?php echo esc_html__('Separate multiple values with a comma.', 'mailchimp-for-wp'); ?>
</p>
</td>
</tr>
<?php do_action('mc4wp_admin_form_after_mailchimp_settings_rows', $opts, $form); ?>
</table>
<div class="mc4wp-margin-m"></div>
<h3><?php echo esc_html__( 'Form behaviour', 'mailchimp-for-wp' ); ?></h3>
<h3><?php echo esc_html__('Form behaviour', 'mailchimp-for-wp'); ?></h3>
<table class="form-table" style="table-layout: fixed;">
<?php
/** @ignore */
do_action( 'mc4wp_admin_form_before_behaviour_settings_rows', $opts, $form );
?>
<?php do_action('mc4wp_admin_form_before_behaviour_settings_rows', $opts, $form); ?>
<tr valign="top">
<th scope="row"><?php echo esc_html__( 'Hide form after a successful sign-up?', 'mailchimp-for-wp' ); ?></th>
<td class="nowrap">
<label>
<input type="radio" name="mc4wp_form[settings][hide_after_success]" value="1" <?php checked( $opts['hide_after_success'], 1 ); ?> />&rlm;
<?php echo esc_html__( 'Yes', 'mailchimp-for-wp' ); ?>
</label> &nbsp;
<label>
<input type="radio" name="mc4wp_form[settings][hide_after_success]" value="0" <?php checked( $opts['hide_after_success'], 0 ); ?> />&rlm;
<?php echo esc_html__( 'No', 'mailchimp-for-wp' ); ?>
</label>
<p class="description">
<?php echo esc_html__( 'Select "yes" to hide the form fields after a successful sign-up.', 'mailchimp-for-wp' ); ?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_redirect"><?php echo esc_html__( 'Redirect to URL after successful sign-ups', 'mailchimp-for-wp' ); ?></label></th>
<td>
<input type="text" class="widefat" name="mc4wp_form[settings][redirect]" id="mc4wp_form_redirect" placeholder="<?php echo sprintf( esc_attr__( 'Example: %s', 'mailchimp-for-wp' ), esc_attr( site_url( '/thank-you/' ) ) ); ?>" value="<?php echo esc_attr( $opts['redirect'] ); ?>" />
<p class="description">
<?php echo wp_kses( __( 'Leave empty or enter <code>0</code> for no redirect. Otherwise, use complete (absolute) URLs, including <code>http://</code>.', 'mailchimp-for-wp' ), array( 'code' => array() ) ); ?>
</p>
<p class="description">
<?php echo esc_html__( 'Your "subscribed" message will not show when redirecting to another page, so make sure to let your visitors know they were successfully subscribed.', 'mailchimp-for-wp' ); ?>
</p>
<tr valign="top">
<th scope="row"><?php echo esc_html__('Hide form after a successful sign-up?', 'mailchimp-for-wp'); ?></th>
<td class="nowrap">
<label>
<input type="radio" name="mc4wp_form[settings][hide_after_success]" value="1" <?php checked($opts['hide_after_success'], 1); ?> />&rlm;
<?php echo esc_html__('Yes', 'mailchimp-for-wp'); ?>
</label> &nbsp;
<label>
<input type="radio" name="mc4wp_form[settings][hide_after_success]" value="0" <?php checked($opts['hide_after_success'], 0); ?> />&rlm;
<?php echo esc_html__('No', 'mailchimp-for-wp'); ?>
</label>
<p class="description">
<?php echo esc_html__('Select "yes" to hide the form fields after a successful sign-up.', 'mailchimp-for-wp'); ?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php echo esc_html__('Enable email domain typo checker?', 'mailchimp-for-wp'); ?></th>
<td class="nowrap">
<label>
<input type="radio" name="mc4wp_form[settings][email_typo_check]" value="1" <?php checked($opts['email_typo_check'], 1); ?> />&rlm;
<?php echo esc_html__('Yes', 'mailchimp-for-wp'); ?>
</label> &nbsp;
<label>
<input type="radio" name="mc4wp_form[settings][email_typo_check]" value="0" <?php checked($opts['email_typo_check'], 0); ?> />&rlm;
<?php echo esc_html__('No', 'mailchimp-for-wp'); ?>
</label>
<p class="description">
<?php echo esc_html__('When enabled, the form will suggest corrections for common email domain typos (e.g., "gmial.com" → "gmail.com").', 'mailchimp-for-wp'); ?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_redirect"><?php echo esc_html__('Redirect to URL after successful sign-ups', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" name="mc4wp_form[settings][redirect]" id="mc4wp_form_redirect" placeholder="<?php echo sprintf(esc_attr__('Example: %s', 'mailchimp-for-wp'), esc_attr(site_url('/thank-you/'))); ?>" value="<?php echo esc_attr($opts['redirect']); ?>" />
<p class="description">
<?php echo wp_kses(__('Leave empty or enter <code>0</code> for no redirect. Otherwise, use complete (absolute) URLs, including <code>http://</code>.', 'mailchimp-for-wp'), [ 'code' => [] ]); ?>
</p>
<p class="description">
<?php echo esc_html__('Your "subscribed" message will not show when redirecting to another page, so make sure to let your visitors know they were successfully subscribed.', 'mailchimp-for-wp'); ?>
</p>
</td>
</tr>
</td>
</tr>
<?php
/** @ignore */
do_action( 'mc4wp_admin_form_after_behaviour_settings_rows', $opts, $form );
?>
<?php do_action('mc4wp_admin_form_after_behaviour_settings_rows', $opts, $form); ?>
</table>