FWSMC_options_page

The MailChimp Subscription Plus FWSMC options page function.

Description

FWSMC_options_page(); 

Usage

  1. if ( !function_exists( 'FWSMC_options_page' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'mailchimp-subscription-plus/mailchimp-subscription-plus.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = FWSMC_options_page(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/mailchimp-subscription-plus.php  
  1. function FWSMC_options_page() { 
  2.  
  3. echo ' 
  4. <div class="wrap"> 
  5. <h2>MailChimp Subscription Plus</h2> 
  6. <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> 
  7. <p>'.__( 'Enter below the required settings and click the button below to safe them.', 'fws-mailchimp-subscribe' ).'</p>'; 
  8.  
  9. echo ' 
  10. <form action="options.php" method="post">'; 
  11. settings_fields( 'FWSMC_options' ); 
  12. echo ' 
  13. <h3>'.__( 'Configuration', 'fws-mailchimp-subscribe' ).'</h3> 
  14.  
  15. <table class="form-table"> 
  16. <tr valign="top"> 
  17. <th scope="row">'.__( ' MailChimp API Key ', 'fws-mailchimp-subscribe' ).'</th> 
  18. <td> 
  19. <input class="regular-text" type="text" placeholder="" value="'.esc_attr( get_option('fwsmc-apiKey') ).'" name="fwsmc-apiKey"> 
  20. <p class="description">'.__( 'Get one from your MailChimp account: Your Account » Extra\'s » API Keys', 'fws-mailchimp-subscribe' ).'</p> 
  21. </td> 
  22. </tr> 
  23. <tr valign="top"> 
  24. <th scope="row">'.__( ' MailChimp List ID ', 'fws-mailchimp-subscribe' ).'</th> 
  25. <td> 
  26. <input class="regular-text" type="text" placeholder="" value="'.esc_attr( get_option('fwsmc-listID') ).'" name="fwsmc-listID"> 
  27. <p class="description">'.__( 'Create a mailing list and enter the ID here: Lists » Settings (at the bottom)', 'fws-mailchimp-subscribe' ).'</p> 
  28. </td> 
  29. </tr> 
  30. <tr valign="top"> 
  31. <th scope="row">'.__( ' Merge field "First name" ', 'fws-mailchimp-subscribe' ).'</th> 
  32. <td> 
  33. <input class="regular-text" type="text" placeholder="" value="'.esc_attr( get_option('fwsmc-firstNameMergField') ).'" name="fwsmc-firstNameMergField"> 
  34. <p class="description">'.__( 'Enter here the merge field for the first name: Lists » Settings » List fields and *|MERGE|* tags', 'fws-mailchimp-subscribe' ).'</p> 
  35. </td> 
  36. </tr> 
  37. <tr valign="top"> 
  38. <th scope="row">'.__( ' Optional merge field (name)', 'fws-mailchimp-subscribe' ).'</th> 
  39. <td> 
  40. <input class="regular-text" type="text" placeholder="" value="'.esc_attr( get_option('fwsmc-extraMergeField') ).'" name="fwsmc-extraMergeField"> 
  41. <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> 
  42. </td> 
  43. </tr> 
  44. <tr valign="top"> 
  45. <th scope="row">'.__( ' Optional merge field (value)', 'fws-mailchimp-subscribe' ).'</th> 
  46. <td> 
  47. <input class="regular-text" type="text" placeholder="" value="'.esc_attr( get_option('fwsmc-extraMergeFieldValue') ).'" name="fwsmc-extraMergeFieldValue"> 
  48. <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> 
  49. </td> 
  50. </tr>'; 
  51. $checkCss = (get_option('fwsmc-include-css')) ? ' checked="checked"' : ''; 
  52. $checkContent = (get_option('fwsmc-addToContent')) ? ' checked="checked"' : ''; 
  53. echo ' 
  54. <tr valign="top"> 
  55. <th scope="row">'.__( ' Include CSS ', 'fws-mailchimp-subscribe' ).'</th> 
  56. <td> 
  57. <label for="fwsmc-include-css"> 
  58. <input id="fwsmc-include-css" type="checkbox" value="1" name="fwsmc-include-css"'.$checkCss.'> 
  59. '.__( 'Include our stylesheet for your web form', 'fws-mailchimp-subscribe' ).' 
  60. </label> 
  61. </td> 
  62. </tr> 
  63. <tr valign="top"> 
  64. <th scope="row">'.__( ' Include the form in all blogs ', 'fws-mailchimp-subscribe' ).'</th> 
  65. <td> 
  66. <label for="fwsmc-addToContent"> 
  67. <input id="fwsmc-addToContent" type="checkbox" value="1" name="fwsmc-addToContent"'.$checkContent.'> 
  68. '.__( 'Use this checkbox to add the subscription form at the end of each blog post.', 'fws-mailchimp-subscribe' ).' 
  69. </label> 
  70. </td> 
  71. </tr> 
  72. </table> 
  73. <h4>'.__( 'Don\'t use the fields below if your Google Analytics or Clicky JavaScript snippet isn\'t installed!', 'fws-mailchimp-subscribe' ).'</h4> 
  74. <table class="form-table"> 
  75. <tr valign="top"> 
  76. <th scope="row">'.__( ' Track page views in Google Analytics ', 'fws-mailchimp-subscribe' ).'</th> 
  77. <td> 
  78. <input class="regular-text" type="text" placeholder="" value="'.esc_attr( get_option('fwsmc-googleanalytics') ).'" name="fwsmc-googleanalytics"> 
  79. <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> 
  80. </td> 
  81. </tr> 
  82. <tr valign="top"> 
  83. <th scope="row">'.__( ' Track goals in Clicky ', 'fws-mailchimp-subscribe' ).'</th> 
  84. <td> 
  85. <input class="regular-text" type="text" placeholder="" value="'.esc_attr( get_option('fwsmc-clickyanalytics') ).'" name="fwsmc-clickyanalytics"> 
  86. <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> 
  87. </td> 
  88. </tr> 
  89. </table> 
  90.  
  91. <p class="submit"> 
  92. <input class="button-primary" type="submit" value="'.__( 'Save Changes', 'fws-mailchimp-subscribe' ).'"> 
  93. </p> 
  94. </form>'; 
  95. if (get_option('fwsmc-apiKey')) echo ' 
  96. <h3>'.__( 'How to use?', 'fws-mailchimp-subscribe' ).'</h3> 
  97. <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> 
  98. <p><code>[FWSSubscriptionForm]</code>   <code>[FWSSubscriptionForm extramergefield="via blog post"]</code></p> 
  99. </div>';