As it is now, when I trash a post, the related comments get deleted at once. Is this standard?
Instead I'd like them to be moved to the trash bin, when I trash the post.
How can I achieve this? I can't seem to find a solution.
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
Well, this is partly true and partly false.
When you trash a post, everything that is tied to it is also trashed. This means, if you untrash the post, the comments etc. are untrashed as well.
However, comments and other stuff is not handled as if they were trashed directly (i.e., on the Comments page in your WordPress Admin). If you directly trash a comment, it shows up in the comments trash bin.
The reason for this is: If comments of recently trashed posts appear in the comments trash bin, you can easily untrash them. But what if not just the comment had been trashed but the related post (and so the comment)? Then you either had to automatically untrash the post as well, or don't provide any means to untrash a comment that was trashed due to its post being trashed.
In short: if you just trash a post, none of the tied-to-it data gets deleted—it gets trashed as well.
I hope this makes sense.