1

I need to limit period od post publication - admin type date, for example, 30.05.2016 in custom fields and then i need to hide custom posts with this date less, then today date

How i can do this?

  • You just need to show us what you did so far. But here's a little process. Create a custom cron that runs daily or with custom interval using wp_schedule_event() and while hooking into this event, verify each post's submission date and get the time difference. If the difference is greater than your length e.g 1month, then use wp_update_post() to set the status to pending or something else.. – Samuel Elh May 24 '16 at 13:44
-1

Have you looked into expire plugins ? https://wordpress.org/plugins/search.php?q=expire

finally wordpress.org/plugins/post-expiring seems to have done the job.

  • Oh, thanks! Plugin wordpress.org/plugins/post-expiring help me! I exchange post_type in plugin's code and show expire date in additional post column with post meta of this plugin. Work great! – Den May 24 '16 at 15:41
  • Don't understood that Gabrial said – Den May 24 '16 at 15:45
  • He said that what I came up with was not a proper answer as such. I should have put that information into a comment, but I didn't have the 50 required points to have rights to comment... so he was just reminding me the rules. – Antony Gibbs May 24 '16 at 15:48
  • What I love in this network is how fast people who are not concerned by the question can vote down on an answer... I admit my answer is of a poor quality, all I was saying is that the keyword for what was looked for was probably "expire" – Antony Gibbs May 24 '16 at 15:52
  • Exactly, Antony. I can't formulated my problem and i realy needed keyword "expire")) Thanks again) – Den May 24 '16 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.