-
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to create a bidirectional custom field? #247
Comments
I'm pretty sure all config options will be passed through to ACF, so it should 'just work' :) give it a try! + PR's always welcome if improvements needed in the docs |
This should help from the ACF Builder repo - StoutLogic/acf-builder#121 (comment) |
Source: ACF docs |
Thanks for the quick response, looks promising. However, on my end it does not work. Here is my code:
As you can see I use the value in the array key |
Did you ever manage to figure this out? Can you try the latest version of ACF Composer? |
Sorry for the late response. I missed your reply. Sadly, I did not figure out what is going wrong. To this day I still have some projects where we'd like to apply bi-directional fields, but it's not working. I am running the latest version of ACF Composer. |
@tislars $productGroup
->setLocation('post_type', '==', 'product-group')
->addRelationship('group_product_locations', [
'post_type' => 'product-location',
'instructions' => '',
'bidirectional' => true,
'bidirectional_target' => [
0 => 'related_field_name_here'
],
'filters' => [
0 => 'search',
],
]); |
In the current version of ACF Pro you are able to create a custom field with a bidirectional relationship. Is this possible with acf-composer? I do not see any related information in this repository or the cheatsheet.
The text was updated successfully, but these errors were encountered: