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?
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.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.