Reputation: 1845
I've created an advanced custom field with the field type of post object. I somehow load all the data in the list but the data it shows is Auto draft. How can I output the proper data? Thanks
Upvotes: 0
Views: 725
Reputation: 11
function my_relationship_filter( $args, $field, $post_id )
{
$args['post_status'] = array('publish');
return $args;
}
add_filter('acf/fields/relationship/query', 'my_relationship_filter', 10, 3);
Thanks for good question. For me helps this code.
Upvotes: 1