Support

Account

Home Forums General Issues only show published posts in Relationship / Post / Page Link picker etc Reply To: only show published posts in Relationship / Post / Page Link picker etc

  • I had to look it up because I was under the impression that only published posts would be returned but

    From: https://codex.wordpress.org/Class_Reference/WP_Query
    post_status (string / array) – use post status. Retrieves posts by Post Status. Default value is ‘publish’, but if the user is logged in, ‘private’ is added. Public custom statuses are also included by default. And if the query is run in an admin context (administration area or AJAX call), protected statuses are added too. By default protected statuses are ‘future’, ‘draft’ and ‘pending’.

    These are retrieved using a AJAX call.

    Anyway, these augments used in a relationship field can be altered using an acf/fields/relationship/query filter https://www.advancedcustomfields.com/resources/acf-fields-relationship-query/. The post object field has a similar hook https://www.advancedcustomfields.com/resources/acf-fields-post_object-query/

    As far as the link field goes, I don’t have a clue about this one. It appears to use the built in WP link popup, but after testing, this only appears to return published posts.