Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I need to create a feed (RSS or Atom) of posts and comments that have been deleted (ie moved to Trash).

What's the best way of doing this? Right now I'm thinking about creating 2 pages templates containing a SQL / $wpdb query that returns posts and comments with trashed status (and then creating new pages eg deletedposts / deletedcomments)

Any better ways? Main reason for doing it this way is easy routing - ie the URLs are created for me. How would I handle the routing if I put this in a plugin and don't create pages?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Well if you want a feed it would be logical to create a feed, rather than emulate it with page.

add_feed() ( source ) and your queries+output in callback.

share|improve this answer
    
Ah - ok, that's exactly what I was looking for - cheers. –  anu Apr 18 '11 at 13:41
add comment

Maybe the easiest thing to do is create a category called Trash and move your posts there; then you've got an automatic post and comment feed without a plugin or custom queries and with a slug of Trash.

share|improve this answer
    
But then I'd need to filter out that category in every loop / query in the rest of the site –  anu Apr 18 '11 at 13:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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