FWSMC_options_page
The MailChimp Subscription Plus FWSMC options page function.
Description
FWSMC_options_page();
Usage
if ( !function_exists( 'FWSMC_options_page' ) ) { require_once ABSPATH . PLUGINDIR . 'mailchimp-subscription-plus/mailchimp-subscription-plus.php'; } // NOTICE! Understand what this does before running. $result = FWSMC_options_page();
Defined (1)
The function is defined in the following location(s).
- /mailchimp-subscription-plus.php
- function FWSMC_options_page() {
- echo '
- <div class="wrap">
- <h2>MailChimp Subscription Plus</h2>
- <p>'.sprintf ( __( 'You need a working MailChimp account, a valid API key and mailing list ID to use this plugin. Register a free <a href="%s">Mailchimp account</a>, setup a mailing list and get an API key.', 'fws-mailchimp-subscribe' ), esc_url( 'http://eepurl.com/r54KL' ) ).'</p>
- <p>'.__( 'Enter below the required settings and click the button below to safe them.', 'fws-mailchimp-subscribe' ).'</p>';
- echo '
- <form action="options.php" method="post">';
- settings_fields( 'FWSMC_options' );
- echo '
- <h3>'.__( 'Configuration', 'fws-mailchimp-subscribe' ).'</h3>
- <table class="form-table">
- <tr valign="top">
- <th scope="row">'.__( ' MailChimp API Key ', 'fws-mailchimp-subscribe' ).'</th>
- <td>
- <input class="regular-text" type="text" placeholder="" value="'.esc_attr( get_option('fwsmc-apiKey') ).'" name="fwsmc-apiKey">
- <p class="description">'.__( 'Get one from your MailChimp account: Your Account » Extra\'s » API Keys', 'fws-mailchimp-subscribe' ).'</p>
- </td>
- </tr>
- <tr valign="top">
- <th scope="row">'.__( ' MailChimp List ID ', 'fws-mailchimp-subscribe' ).'</th>
- <td>
- <input class="regular-text" type="text" placeholder="" value="'.esc_attr( get_option('fwsmc-listID') ).'" name="fwsmc-listID">
- <p class="description">'.__( 'Create a mailing list and enter the ID here: Lists » Settings (at the bottom)', 'fws-mailchimp-subscribe' ).'</p>
- </td>
- </tr>
- <tr valign="top">
- <th scope="row">'.__( ' Merge field "First name" ', 'fws-mailchimp-subscribe' ).'</th>
- <td>
- <input class="regular-text" type="text" placeholder="" value="'.esc_attr( get_option('fwsmc-firstNameMergField') ).'" name="fwsmc-firstNameMergField">
- <p class="description">'.__( 'Enter here the merge field for the first name: Lists » Settings » List fields and *|MERGE|* tags', 'fws-mailchimp-subscribe' ).'</p>
- </td>
- </tr>
- <tr valign="top">
- <th scope="row">'.__( ' Optional merge field (name)', 'fws-mailchimp-subscribe' ).'</th>
- <td>
- <input class="regular-text" type="text" placeholder="" value="'.esc_attr( get_option('fwsmc-extraMergeField') ).'" name="fwsmc-extraMergeField">
- <p class="description">'.__( 'Use this optional merge field for a unique ID if you use the same list ID on different places.', 'fws-mailchimp-subscribe' ).'</p>
- </td>
- </tr>
- <tr valign="top">
- <th scope="row">'.__( ' Optional merge field (value)', 'fws-mailchimp-subscribe' ).'</th>
- <td>
- <input class="regular-text" type="text" placeholder="" value="'.esc_attr( get_option('fwsmc-extraMergeFieldValue') ).'" name="fwsmc-extraMergeFieldValue">
- <p class="description">'.__( 'Add here the value for your additional merge field. You can overule this value if you use the form shortcode!', 'fws-mailchimp-subscribe' ).'</p>
- </td>
- </tr>';
- $checkCss = (get_option('fwsmc-include-css')) ? ' checked="checked"' : '';
- $checkContent = (get_option('fwsmc-addToContent')) ? ' checked="checked"' : '';
- echo '
- <tr valign="top">
- <th scope="row">'.__( ' Include CSS ', 'fws-mailchimp-subscribe' ).'</th>
- <td>
- <label for="fwsmc-include-css">
- <input id="fwsmc-include-css" type="checkbox" value="1" name="fwsmc-include-css"'.$checkCss.'>
- '.__( 'Include our stylesheet for your web form', 'fws-mailchimp-subscribe' ).'
- </label>
- </td>
- </tr>
- <tr valign="top">
- <th scope="row">'.__( ' Include the form in all blogs ', 'fws-mailchimp-subscribe' ).'</th>
- <td>
- <label for="fwsmc-addToContent">
- <input id="fwsmc-addToContent" type="checkbox" value="1" name="fwsmc-addToContent"'.$checkContent.'>
- '.__( 'Use this checkbox to add the subscription form at the end of each blog post.', 'fws-mailchimp-subscribe' ).'
- </label>
- </td>
- </tr>
- </table>
- <h4>'.__( 'Don\'t use the fields below if your Google Analytics or Clicky JavaScript snippet isn\'t installed!', 'fws-mailchimp-subscribe' ).'</h4>
- <table class="form-table">
- <tr valign="top">
- <th scope="row">'.__( ' Track page views in Google Analytics ', 'fws-mailchimp-subscribe' ).'</th>
- <td>
- <input class="regular-text" type="text" placeholder="" value="'.esc_attr( get_option('fwsmc-googleanalytics') ).'" name="fwsmc-googleanalytics">
- <p class="description">'.__( 'Track a page view in Google analytics after the subscription form is submitted (f.e. /subscription/submitted.html).', 'fws-mailchimp-subscribe' ).'</p>
- </td>
- </tr>
- <tr valign="top">
- <th scope="row">'.__( ' Track goals in Clicky ', 'fws-mailchimp-subscribe' ).'</th>
- <td>
- <input class="regular-text" type="text" placeholder="" value="'.esc_attr( get_option('fwsmc-clickyanalytics') ).'" name="fwsmc-clickyanalytics">
- <p class="description">'.__( 'Add here the goal ID for a manual goal you\'ve already defined in Clicky (check the FAQ for information).', 'fws-mailchimp-subscribe' ).'</p>
- </td>
- </tr>
- </table>
- <p class="submit">
- <input class="button-primary" type="submit" value="'.__( 'Save Changes', 'fws-mailchimp-subscribe' ).'">
- </p>
- </form>';
- if (get_option('fwsmc-apiKey')) echo '
- <h3>'.__( 'How to use?', 'fws-mailchimp-subscribe' ).'</h3>
- <p>'.__( 'You can use the subscription form in every post (see setting above) or you can use the widget into your sidebar. It\'s also possible to use a shortcode into your page or post.', 'fws-mailchimp-subscribe' ).'</p>
- <p><code>[FWSSubscriptionForm]</code> <code>[FWSSubscriptionForm extramergefield="via blog post"]</code></p>
- </div>';
- }