How to release content in wordpress after X days user registration

Asked

Viewed 88 times

0

I’m developing a member area in Wordpress, and I need to limit access according to the user’s registration date. I already have the registration date and already have the amount of days that the user is registered using php’s Diff function.

Example:

User registers today and has access to page X, he can only see page Y after 10 Days, if he has fewer days, display an error message and with 10 days or more, I release the page.

Can be plugin, no problem.

  • you can sweat the `date('suaData', '+10 day'); and check with diff again.

  • But how could I do that with more than 10 pages per example? because all pages use the page.php file and I need different days for each page created.

1 answer

0


You will add in the database the date the user signed up, and create for each page a validation that takes the current date and compares with the registration date.

If ($daysCasted > $daysExibir) { Include 'suaPagina.php'; }

This is the basic idea, in your case just add in the bank the moment he accessed the page

Browser other questions tagged

You are not signed in. Login or sign up in order to post.