Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
David Ribatto

Smart filter – Search comparison

I would like to konow how I can use :

ACP\Search\Comparison\Meta\Post

I Have a ACF Field – Post object type.
I Would like to search in a custom field of a custom post – my value in the column is the post_id of the custom post

3 weeks, 5 days ago
Stefan van den Dungen Gronovius
Developer

When you have an ACF Post Object field and you want to create a column for that specific field, the most easy thing to do is to add the ACF column for that field. All ACF columns are prefixed with a green ACF logo when you add a new column. When using this column type for an ACF field, that Search Comparison is automatically used for that field type.

Or do you want to create your own custom column? It is not possible to select a comparison with the UI for a column, only if you write your own columns.

3 weeks, 3 days ago
David Ribatto

I created my own custom column because if I choose ACF field in the dropdown, it display the post title or the post ID. I want to display a custom field, so I created my own custom column and it works great.

But, when I want to use smart filter, I want to search in my custom field. I didn’t succeed.

3 weeks, 1 day ago
Stefan van den Dungen Gronovius
Developer

Ah I see what you’re trying to do.
To be honest, in our column, changing the display of a related post, does not change the way that search works.
The comparison that you use, does search the title and content for related posts, no matter the display. If you want to search the meta of the related post, you’ll need to write your own comparison. I recommend using the ‘Contains’ operator and you’ll need to apply your own join query to get all posts that have provided meta based on the given value. Seen the structure of the WordPress tables, I suspect that will not be very fast though.

3 weeks ago

You must be logged in to reply to this topic.