Recycle Bin, Draft and Pending Revision in wordpress, how do they work?

Asked

Viewed 396 times

3

Good afternoon, I would like some help from you, I need to take a post off the air, but I would like to reactivate it regardless of the time of passing, if in a year I want to publish it again as I should, because after a while all the posts in the trash can begin to disappear, the only alternative I found on the internet was to use

define( 'EMPTY_TRASH_DAYS', 365 );

but after 365 the same is deleted permanently? and I can use a period has long like this, or there is another way to leave the post as draft?

2 answers

2


just leave the post in draft it will not be deleted, that line:

define( 'EMPTY_TRASH_DAYS', 365 );

is about cleaning the posts that are already in the trash, the draft is not considered trash. I’m gonna leave this link documentation on the subject

  • Thank you @Danilo D, I read the documentation and found no mention of using values greater than 30 days, I also read the status of the posts available for publication [https://codex.wordpress.org/Post_Status], I will send the data I want to save to the draft...

2

I believe that the EMPTY_TRASH_DAYS be only for when delete, this does not affect the "drafts", then simply remove from the post, but if I am mistaken believe that just remove the action wp_schedule_delete, thus:

function my_remove_schedule_delete() {
    remove_action( 'wp_scheduled_delete', 'wp_scheduled_delete' );
}

add_action( 'init', 'my_remove_schedule_delete' );
  • I am still very new in wordpress I have a little bit of fear in changing the files, but thank you very much @Guilhermenascimento

  • 1

    @Wagnerfernandomomasso really has nothing to do with the drafts, the EMPTY_TRASH_DAYS It’s only for permanently deleting, so you don’t even have to touch anything :)

Browser other questions tagged

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