Home Forums Feature Requests Relationship: Post Children Filter Reply To: Relationship: Post Children Filter

  • Being on ACF Pro it still doesn’t seem to work. When I add it to my functions.php, and I really took care of it being proper, I only get a spinning loading animation, but no pages are being shown which I could select. If I leave off the filter, the field then works well (but of course showing all instead of only pages of the current page). Or did I miss anything here?

    Code is standard:

    function childpages_query( $args, $field, $post )
        $args['post_parent'] = $post->ID;
        return $args;
    add_filter('acf/fields/relationship/query/name=pages_childpages', 'childpages_query', 10, 3);

    Thanks for any help in advance ;).