Home › Forums › Feature Requests › Display relationship objects custom fields in relationship search › Reply To: Display relationship objects custom fields in relationship search
Hi @dademaru
I couldn’t agree more, this would be a great feature, but one which would be hard to add to the core. Perhaps you could use some jQuery to append this ‘SKU’ filter to the relationship field.
If you view the DOM of the relationship field, you will notice many data- attributes. All of these attributes are posted to the AJAX query which populates the relationship choices (left column).
If you wrote some jQuery to add in a new text input which on change, would update a data-sku attribute, then this would be posted to the AJAX query.
Step 2 would be to hook into the relationship query (there is documentation for this on the docs page) and use the posted sku value to modify the WP_Query args!
Thanks
E
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.