theme-options.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /*
  3. * This is a pre packaged theme options page. Every option name
  4. * must start with "theme_" so Newsletter can distinguish them from other
  5. * options that are specific to the object using the theme.
  6. *
  7. * An array of theme default options should always be present and that default options
  8. * should be merged with the current complete set of options as shown below.
  9. *
  10. * Every theme can define its own set of options, the will be used in the theme.php
  11. * file while composing the email body. Newsletter knows nothing about theme options
  12. * (other than saving them) and does not use or relies on any of them.
  13. *
  14. * For multilanguage purpose you can actually check the constants "WP_LANG", until
  15. * a decent system will be implemented.
  16. */
  17. if (!defined('ABSPATH'))
  18. exit;
  19. $theme_defaults = array(
  20. 'theme_max_posts'=>10,
  21. 'theme_categories'=>array()
  22. );
  23. // Mandatory!
  24. $controls->merge_defaults($theme_defaults);
  25. ?>
  26. <table class="form-table">
  27. <tr>
  28. <th>Max new posts to include</th>
  29. <td>
  30. <?php $controls->text('theme_max_posts', 5); ?> (it defaults to 10 if empty or invalid)
  31. </td>
  32. </tr>
  33. <tr>
  34. <th>Categories</th>
  35. <td>
  36. <?php $controls->categories_group('theme_categories'); ?>
  37. </td>
  38. </tr>
  39. </table>
  40. <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>