Limit custom select to non-revision, non-trash rows
-
BH
I was a bit surprised at coming up empty after searching for an answer to this – maybe I’m just not looking correctly.
I have taken to using custom queries for various plugins, extensions and functionality. Most recently I implemented a custom post type for events which stores a timestamp as meta data. By selecting rows with timestamps greater then time() I am able to retrieve all future events, and of course less than time() is past events.
Is there any resource that lists the various issues to watch for when writing a custom query to get a post, things like post_status == trash, or == revision?
If there is and I am not finding it, would someone kindly point me to it? If there is not, it would make a good addition to the online documentation.
- The topic ‘Limit custom select to non-revision, non-trash rows’ is closed to new replies.