Home › Forums › Feature Requests › Display relationship objects custom fields in relationship search › Reply To: Display relationship objects custom fields in relationship search
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!
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!
The ACF site is currently experiencing some issues.— Advanced Custom Fields (@wp_acf) September 21, 2022
We apologize for the inconvenience and we are working hard to get it back up and running as soon as possible.
© 2022 Advanced Custom Fields.