I have the following ocde that blocks any user from seeing post before the date they subscribe.
I would like to change it so that the user can see any future posts and any that have been made 30 days before.
I can not work this out/make it owrk. Any ideas?
public function should_protect_older_post($output, $id) {
$auth = SwpmAuth::get_instance();
$perms = SwpmPermission::get_instance($auth->get('membership_level'));
$protect_older_posts = $perms->get('protect_older_posts');
$post = get_post($id);
return (!empty($protect_older_posts) && (strtotime($post->post_date) < strtotime($auth->get('subscription_starts'))));
````your text`
New contributor
rob Farrell is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.