Home › Forums › General Issues › How to get field key from database? › Reply To: How to get field key from database?
Hi,
I have a very similar problem. I’m currently using:
'post_content' => $_POST['fields']['field_53701c4623c64'],
to pass the value of a custom field I called ‘content’.
Is there any way to call the field key from the database using the field name? Or to set the field name as the input tag name in the DOM instead of the field key? As @funack mentioned using the field key requires hardcoding when using different environments.
Also, in case this is not possible, if I include ACF within my WP Theme will any custom field keys I create be kept? (so other users can plug and play?) I don’t think it will be because it gets the values from the database or is this not the case?
I would appreciate any help.
Thanks
Carlos
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.