vinkla / extended-acf

Register advanced custom fields with object-oriented PHP
MIT License
455 stars 61 forks source link

Bidirectional Relationships #157

Open antoine-waag opened 1 month ago

antoine-waag commented 1 month ago

I would like to implement a bidirectional field with a Relationship component but it seems not implemented yet.

https://www.advancedcustomfields.com/resources/bidirectional-relationships/

vinkla commented 1 month ago

You're welcome to submit a pull request to add this feature. The challenge is that the keys are automatically generated. I haven't thoroughly examined this yet, but it seems that users would need to set custom field keys.

antoine-waag commented 1 month ago

@vinkla yes, the most difficult part is to get the field key reference from a field name and the post types list defined in the RelationShip field.

It seems, there is no function to get that key reference easily. All functions ask for $post_id

If you have any suggestion to achieve this issue, please let me know