Get() is returning unpublished/trashed items
-
I am using CFS with a custom post type (‘writers’) which includes a related field, so each writer can state which other writers they are similar to. To show a complete list of who is related to a given writer, I combine two lookups: a simple lookup of their ‘related’ field and a reverse lookup of other writers and their ‘related’ fields.
By default get() and get_reverse_related are returning all ‘writer’ records including those that are draft or in trash. I need to filter this to just return those that are published.
With get_reverse_related this is fine:
CFS()->get_reverse_related($post->ID, array(‘field_name’ => ‘similar_to’, ‘post_status’ => ‘publish’));
However I cannot work out how to filter the output of get() in a similar way so that it returns just published ‘writers’.
Please can you help, or give me some pointers?
Thanks,
Philip
- The topic ‘Get() is returning unpublished/trashed items’ is closed to new replies.