I have encountered this problem many times. This problem only happen when I programmatically create/edit posts. They could be customs post or even Wordpress' default post. The symptoms could be:
- The posts are not visible in admin dashboard. Post count of that custom post type still increase but no post is displayed in the list.
- Created posts are not query-able, even when
post_status
is set to'any'
. Curiously when I setpost_status
topublished
it works.
This is a self-answered question. I encountered this problem several times before and always forget its cause. And searches hint to possibilities that many others are stuck without solution too.