Home Forums ACF PRO ACF Pro search issues in admin


ACF Pro search issues in admin

  • I’m having issues with search functionality from the admin area with ACF Pro. We have a custom post type with a ACF Pro field that associates another post type with the current one.

    The field actually works, but the search bar associated with it doesn’t, so you have to scroll through all the options to find the desired field.

    I’ve tracked the problem down. The ajax call goes to:
    which calls the ajax_query function in includes/fields/class-acf-field-relationship.php

    on line 223 it calls $groups = acf_get_grouped_posts( $args );
    the $args variable:
    [posts_per_page] => 20
    [paged] => 1
    [s] => 5G in
    [post_type] => Array
    [0] => product


    the ajax then returns:{“results”:[],”more”:false,”limit”:0}

    if I hack it and replace that line with:
    $groups = acf_get_grouped_posts( array(“post_type”=>”product”) );

    I get results back.

    on line 162, i see:
    $args[‘post_type’] = acf_get_array( $field[‘post_type’] );
    which is pulling this array of post types instead of the string “product”. I tried removing the acf_get_array function, but still get the same result.

    Is this a possible configuration error or this indeed a bug?

  • I’m having the exact same problem.
    Did you find out why it is happening?

  • Having the same problem here: simple page link field (acf-field-page-link) search works for native pages and posts, but the search field doesn’t work for custom post types.

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

The topic ‘ACF Pro search issues in admin’ is closed to new replies.