I have set up a Post Object field. Which by default displays as a drop-down selector. It references the Products in Woocommerce.
By default the Post Object field pulls in the post title as the option value and as the text shown in the selector. E.g. <option value="product-title">product-title</option>
In my case many of the items have the same title. So it is impossible to tell them apart.
Is there a function I can set up in functions.php to modify what’s used for the option text?
In this instance at the very least I’d like to include the product ID, and ideally the SKU.
e.g.
<option value="product-title">product-title - PostID - SKU</option>
Is this possible?
A post object field should set the option value to the post ID and the label to the post Title.
There is a filter that can be used to alter the label acf/fields/post_object/result.