Home › Forums › Feedback › Building relations with ID › Reply To: Building relations with ID
How do you know what user (supplier) is adding a post? Do they select this or is it dynamically generated?
If you user is logged in, couldn’t you use the user_id? If a supplier has multiple users, are do you associate a logged in user with a supplier?
Do you set up the supplier post? You could have a “user” type field where you select the users that are associated with the supplier. Then you can query the supplier posts based on the user that is currently logged in it get the supplier ID (which will have a unique Post ID). Then you can add the supplier POST ID to rooms and facilities posts when they are created. This could be a field in ACF, or it could be a custom field that is not part of ACF because it’s only used to tie things together.
ACF field groups are have unique ID values. What doe not have unique ID’s are the custom fields themselves. But there are plenty of unique ID’s floating around in WP.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
The most recent ACF Chat Friday featured a live demo of how to register CPTs directly in the plugin, one of our most requested features. Check out the summary below for a replay of the demo, and don’t forget to register for the next session! https://t.co/k2KQ3WWBAz— Advanced Custom Fields (@wp_acf) March 9, 2023
© 2023 Advanced Custom Fields.