Support

Account

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