Page 1 of 1
How to deactivate user post once his membership expired?
Posted:
March 12th, 2011, 7:15 pm
by candy
Hi,
If I have a user with level 1 paid membership who is allowed to post content (write posts), what will happen with his posts once the membership expires and he does not renew?
I'd like at least content posted by this user in a certain category to be deactivated once the user is not a valid member anymore.
How can this be done?
Thanks a lot!
Re: How to deactivate user post once his membership expired?
Posted:
March 12th, 2011, 9:27 pm
by Cristián Lávaque
By "deactivate" you mean taking it off the website?
Re: How to deactivate user post once his membership expired?
Posted:
March 12th, 2011, 9:57 pm
by candy
yes, make it invisible, eventually change the post status to "draft" ...
So if the original poster does not renew its membership, his post will be taken down as well (status changed to "draft")
Thanks!
Re: How to deactivate user post once his membership expired?
Posted:
March 13th, 2011, 9:51 am
by candy
Seeing the post is not limited to logged in users, visitors can also see it. That's why I need to find a way to connect the post "author" to the status of a s2 member ...
So basically I can image to have to wrap up the post code in "single.php" in smth like this:
if author = is a s2member that can see level 1
than > show post
else > set post status to "draft"
But I have NO clue how to write the php code for that, can anyone please help?
(a "s2member that can see level 1" would imply he has paid his subscription)
Help please!
Thank you!
PS: any other, better idea anytime more than welcomed!
Re: How to deactivate user post once his membership expired?
Posted:
March 15th, 2011, 3:39 pm
by Cristián Lávaque
Well, s2Member doesn't do this, but it should be possible for a developer to add this functionality. You can find experienced freelance coders over at oDesk, eLance, Freelancer and Rent-a-coder.
Here are a couple of references that may help achieve this.
http://wordpress.stackexchange.com/ques ... than-todayhttp://codex.wordpress.org/Function_Ref ... pdate_post