Support

Account

Forum Replies Created

  • hey Eliot i agree with raison at least in my case this is caused not by repeater but by post object or page link fields on a very large site so i think its a scaling issue i work on a news type site with more than 20000 posts god knows how much draft posts and custom posts and trying to get the post object or page link is breaking the memory limit even on 512 but when i use relationship field to return the post object it works perfectly cause it uses ajax and doesnt load all the post the only problem i have is that relationship fields allow multiple selection i limit it to one in the front end but its not looking good on the backend so my suggesstion would be using a ajax way for post object and page links or having a relationship field that can only select one that would be awesome cause i love the search and filter by post type functionality of it

  • ok i switched to relationship fields and wanted to do same thing

    i did it by filtering the query so for anybody who wants to do the same thing here is the code

    <?php

    function my_post_object_query( $args, $field, $post )
    {
    // modify the order
    $args[‘post_status’] = array(‘publish’);

    return $args;
    }

    // filter for every field post object
    add_filter(‘acf/fields/post_object/query’, ‘my_post_object_query’, 10, 3);
    // filter for every field relationship
    add_filter(‘acf/fields/relationship/query’, ‘my_post_object_query’, 10, 3);

Viewing 3 posts - 1 through 3 (of 3 total)