Hi,
I would like to know if it’s posible to populate the relationship field with posts coming from another site, an external one.
My first thought, was using the WP REST API to populate it, but I can’t find a way to achieve it.
Has anyone a clue to do this or knows about an add-on?
Thanks.
The relationship field in ACF will only work with posts on the same site.
If you’re talking about another site on a multisite installation, there is a custom field add on for this https://github.com/tmconnect/acf-relationship-multisite.
If you’re talking about a completely different site, then you’d need to build a custom field type https://www.advancedcustomfields.com/resources/creating-a-new-field-type/
You could probably also do this using a simple select field and dynamically populate the choices https://www.advancedcustomfields.com/resources/dynamically-populate-a-select-fields-choices/, how you’d get those choices I can’t say.
Thanks John!
I was talking about a different site. Finally I wrote a plugin to accomplish this based on the relationship field.
@bherrero Any chance you could share the code you wrote for this? I’m trying to accomplish the same thing!
Hi Matthew!
I’m asking to my old company, the code belong to them.
Anyway, the plugin is not ACF related, just the appearance is similar to ACF components.
If they allow me to make it public, I’ll post the github link.