Support

Account

Home Forums ACF PRO Filter a post object ONLY for the initial part: is it possible?

Solved

Filter a post object ONLY for the initial part: is it possible?

  • Let’s suppose we have a “Contacts” custom posts with these titles:
    – Willis Bruce
    – John Doe
    – Smith William

    Now, using the “Post Object” field is it possibile select a contact item by filtering for the initial part and not using any piece of the title?
    In this case, if you start writing “Wi” in post object field, it should only return “Willis Bruce” (without Smith William).
    How it is possible?

  • ACF uses the built in WP search for getting the results of these fields. This search looks for your entered text anywhere in the title and content of the post. To do what you want you’d need to alter the way WP does searches.

    See this topic https://support.advancedcustomfields.com/forums/topic/acf-page-link-search-by-title-only/. In your case you’d want to query to have % only at the end of the search terms.

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

The topic ‘Filter a post object ONLY for the initial part: is it possible?’ is closed to new replies.