How do you Default All Pages to be Protected?
-
I’ve been looking at this code to tweak it to auto default to always be protected using the file “class.simple-wp-membership.php”:
// The actual fields for data entry echo '<h4>' . __("Do you want to protect this content?", 'swpm') . '</h4>'; echo '<input type="radio" ' . ((!$is_protected) ? 'checked="checked"' : "") . ' name="swpm_protect_post" value="1" /> No, Do not protect this content. <br/>'; echo '<input type="radio" ' . (($is_protected) ? 'checked' : "") . ' name="swpm_protect_post" value="2" /> Yes, Protect this content.<br/>'; echo '<h4>' . __("Select the membership level that can access this content:", 'swpm') . "</h4>"; $query = "SELECT * FROM " . $wpdb->prefix . "swpm_membership_tbl WHERE id !=1 "; $levels = $wpdb->get_results($query, ARRAY_A); foreach ($levels as $level) { echo '<input type="checkbox" ' . (BPermission::get_instance($level['id'])->is_permitted($id) ? "checked='checked'" : "") . ' name="swpm_protection_level[' . $level['id'] . ']" value="' . $level['id'] . '" /> ' . $level['alias'] . "<br/>";
I can’t seem to get this to work regardless if I move the !$is_protected with the exclamation to protected and many other variations. Is there a way to modify the code to allow for a protective default?
We are just using on membership level, free and active.
Great plug-in. Totally do love the easy of the interface. Thanks!!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How do you Default All Pages to be Protected?’ is closed to new replies.