james
james

Reputation: 1845

Advanced Custom Fields [Post Object - Auto Draft]

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

here is the ss of my dashboard

Upvotes: 0

Views: 725

Answers (1)

user3369380
user3369380

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

Related Questions