I am building a job board and have created a custom field called currency that allows the employer to enter the 'salary currency' in the 'Job' post by creating a custom post field called currency.
Now, I want the job seeker to tell me their salary currency in the user custom field. First, the field created for 'Job' CPT did not show up in the user custom field suggested fields. Second, when I tried to create a custom user field for job seekers with the same slug 'currency' I could not save it.
Can I use the custom field on both post and user. If not, why can't I create another field with the same slug for the user? Are they not considered separate in WordPress?
No, the system will not allow two fields with identical slugs, regardless of whether they are used in User profiles or custom fields. If you create a proxy post type for Users, you could assign the same field group to the proxy post type: https://toolset.com/course-lesson/how-to-create-custom-searches-and-relationships-for-users/
Otherwise, there is not a simple way to directly associate the same custom field slug to a custom post type and a User profile.
That's an interesting workaround. I am gonna keep user data in user meta and use different custom fields to make it work. This seems like a design thing with WordPress but it is what it is.
My issue is resolved now. Thank you!