forked from LiveCarta/LiveCartaWP
Changed source root directory
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
<?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>
|
||||
|
||||
<?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>
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php defined('ABSPATH') or exit;
|
||||
|
||||
$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
|
||||
*/
|
||||
$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> ›
|
||||
<a href="<?php echo esc_url(admin_url('admin.php?page=mailchimp-for-wp-forms')); ?>"><?php echo esc_html__('Forms', 'mailchimp-for-wp'); ?></a>
|
||||
›
|
||||
<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>
|
||||
|
||||
<div>
|
||||
<h1 class="mc4wp-page-title">
|
||||
<?php echo esc_html__('Edit Form', 'mailchimp-for-wp'); ?>
|
||||
|
||||
<?php do_action('mc4wp_admin_edit_form_after_title'); ?>
|
||||
</h1>
|
||||
|
||||
<?php // fake h2 for admin notices ?>
|
||||
<h2 style="display: none;"></h2>
|
||||
|
||||
<?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); ?>"/>
|
||||
|
||||
<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' : '';
|
||||
$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">
|
||||
|
||||
<?php
|
||||
foreach ($tabs as $tab => $name) {
|
||||
$class = ( $active_tab === $tab ) ? 'mc4wp-tab-active' : '';
|
||||
echo "<div class=\"mc4wp-tab {$class}\" id=\"mc4wp-tab-{$tab}\">";
|
||||
|
||||
/**
|
||||
* Runs when outputting a tab section on the "edit form" screen
|
||||
*
|
||||
* @param string $tab
|
||||
*/
|
||||
do_action('mc4wp_admin_edit_form_output_' . $tab . '_tab', $opts, $form);
|
||||
|
||||
$tab_file = __DIR__ . '/tabs/form-' . $tab . '.php';
|
||||
if (file_exists($tab_file)) {
|
||||
include $tab_file;
|
||||
}
|
||||
|
||||
// end of .tab
|
||||
echo '</div>';
|
||||
} // foreach tabs
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php include MC4WP_PLUGIN_DIR . '/includes/views/parts/admin-footer.php'; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,15 @@
|
||||
(function() {
|
||||
window.mc4wp = window.mc4wp || {
|
||||
listeners: [],
|
||||
forms: {
|
||||
on: function(evt, cb) {
|
||||
window.mc4wp.listeners.push(
|
||||
{
|
||||
event : evt,
|
||||
callback: cb
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
@@ -0,0 +1,11 @@
|
||||
function maybePrefixUrlField () {
|
||||
const value = this.value.trim()
|
||||
if (value !== '' && value.indexOf('http') !== 0) {
|
||||
this.value = 'http://' + value
|
||||
}
|
||||
}
|
||||
|
||||
const urlFields = document.querySelectorAll('.mc4wp-form input[type="url"]')
|
||||
for (let j = 0; j < urlFields.length; j++) {
|
||||
urlFields[j].addEventListener('blur', maybePrefixUrlField)
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php defined('ABSPATH') or exit; ?>
|
||||
|
||||
<div class="mc4wp-admin">
|
||||
<h2><?php echo esc_html__('Add more fields', 'mailchimp-for-wp'); ?></h2>
|
||||
|
||||
<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><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>
|
||||
|
||||
<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>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
defined('ABSPATH') or exit;
|
||||
|
||||
$tags = mc4wp('forms')->get_tags();
|
||||
?>
|
||||
<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'), [ '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
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
defined('ABSPATH') or exit;
|
||||
|
||||
// fake post to prevent notices in wp_enqueue_scripts call
|
||||
$GLOBALS['post'] = new \WP_Post((object) [ 'filter' => 'raw' ]);
|
||||
|
||||
// render simple page with form in it.
|
||||
?><!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<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_enqueue_scripts();
|
||||
wp_print_styles();
|
||||
wp_print_head_scripts();
|
||||
|
||||
if (function_exists('wp_custom_css_cb')) {
|
||||
wp_custom_css_cb();
|
||||
}
|
||||
?>
|
||||
<style>
|
||||
body{
|
||||
background: white;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
<?php // hide all other elements except the form preview ?>
|
||||
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>
|
||||
</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 do_action('wp_footer'); ?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
$theme = wp_get_theme();
|
||||
$css_options = [
|
||||
'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') => [
|
||||
'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.
|
||||
*/
|
||||
$css_options = apply_filters('mc4wp_admin_form_css_options', $css_options);
|
||||
|
||||
?>
|
||||
|
||||
<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">
|
||||
|
||||
<?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 do_action('mc4wp_admin_form_after_appearance_settings_rows', $opts, $form); ?>
|
||||
|
||||
</table>
|
||||
|
||||
<?php submit_button(); ?>
|
||||
@@ -0,0 +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>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
|
||||
<!-- 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']); ?>" />
|
||||
|
||||
<?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>
|
||||
|
||||
|
||||
<?php // Content for Thickboxes ?>
|
||||
<div id="mc4wp-form-variables" style="display: none;">
|
||||
<?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'; ?>
|
||||
</div>
|
||||
@@ -0,0 +1,94 @@
|
||||
<?php defined('ABSPATH') or exit;
|
||||
|
||||
/** @var MC4WP_Form $form */
|
||||
?>
|
||||
|
||||
<h2><?php echo esc_html__('Form Messages', 'mailchimp-for-wp'); ?></h2>
|
||||
|
||||
<table class="form-table mc4wp-form-messages">
|
||||
|
||||
<?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 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 = [
|
||||
'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 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>
|
||||
|
||||
<?php submit_button(); ?>
|
||||
@@ -0,0 +1,154 @@
|
||||
<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>
|
||||
|
||||
<table class="form-table" style="table-layout: fixed;">
|
||||
|
||||
<?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__('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 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); ?> />‏
|
||||
<?php echo esc_html__('Yes', 'mailchimp-for-wp'); ?>
|
||||
</label>
|
||||
<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'); ?>');" />‏
|
||||
<?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); ?> />‏
|
||||
<?php echo esc_html__('Yes', 'mailchimp-for-wp'); ?>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="mc4wp_form[settings][update_existing]" value="0" <?php checked($opts['update_existing'], 0); ?> />‏
|
||||
<?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 = [
|
||||
'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); ?> />‏
|
||||
<?php echo esc_html__('Yes', 'mailchimp-for-wp'); ?>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="mc4wp_form[settings][replace_interests]" value="0" <?php checked($opts['replace_interests'], 0); ?> />‏
|
||||
<?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>
|
||||
|
||||
</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>
|
||||
|
||||
<table class="form-table" style="table-layout: fixed;">
|
||||
|
||||
<?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); ?> />‏
|
||||
<?php echo esc_html__('Yes', 'mailchimp-for-wp'); ?>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="mc4wp_form[settings][hide_after_success]" value="0" <?php checked($opts['hide_after_success'], 0); ?> />‏
|
||||
<?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'), [ '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>
|
||||
|
||||
<?php do_action('mc4wp_admin_form_after_behaviour_settings_rows', $opts, $form); ?>
|
||||
|
||||
</table>
|
||||
|
||||
<?php submit_button(); ?>
|
||||
Reference in New Issue
Block a user