• Strange and frustrating problem I’m experiencing here. Here are the steps:

    1. I create a post programmatically, using wp_insert_post. It has several custom fields, one of which is called “Article ID.”

    2. If I try to find this post by using get_posts and passing in “Article ID” as the meta_key and the field’s value as the meta_value, it comes up as expected.

    3. Then I manually go into the post and delete one of the custom fields — NOT Article ID.

    4. Now when using get_posts with the exact same arguments, the post is no longer found.

    Has anyone experienced this? How can I get around it?

The topic ‘Why can't I access custom fields?’ is closed to new replies.