admin_category_list.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <div class="swpm-yellow-box">
  2. <p>
  3. <?php echo SwpmUtils::_('First of all, globally protect the category on your site by selecting "General Protection" from the drop-down box below and then select the categories that should be protected from non-logged in users.'); ?>
  4. </p>
  5. <p>
  6. <?php echo SwpmUtils::_('Next, select an existing membership level from the drop-down box below and then select the categories you want to grant access to (for that particular membership level).'); ?>
  7. </p>
  8. <p>
  9. <?php echo SwpmUtils::_('Read the '); ?><a href="https://simple-membership-plugin.com/use-category-protection-membership-site/" target="_blank"><?php echo SwpmUtils::_('category protection documentation'); ?></a> <?php echo SwpmUtils::_('to learn more.'); ?>
  10. </p>
  11. </div>
  12. <form id="category_list_form" method="post">
  13. <input type="hidden" name="swpm_category_prot_update_nonce" value="<?php echo wp_create_nonce('swpm_category_prot_update_nonce_action'); ?>" />
  14. <p class="swpm-select-box-left">
  15. <label for="membership_level_id"><?php SwpmUtils::e('Membership Level:'); ?></label>
  16. <select id="membership_level_id" name="membership_level_id">
  17. <option <?php echo $category_list->selected_level_id == 1 ? "selected" : "" ?> value="1"><?php echo SwpmUtils::_('General Protection'); ?></option>
  18. <?php echo SwpmUtils::membership_level_dropdown($category_list->selected_level_id); ?>
  19. </select>
  20. </p>
  21. <p class="swpm-select-box-left">
  22. <input type="submit" class="button-primary" name="update_category_list" value="<?php SwpmUtils::e('Update'); ?>">
  23. </p>
  24. <?php $category_list->prepare_items(); ?>
  25. <?php $category_list->display(); ?>
  26. </form>
  27. <script type="text/javascript">
  28. jQuery(document).ready(function($) {
  29. $('#membership_level_id').change(function() {
  30. $('#category_list_form').submit();
  31. });
  32. });
  33. </script>