Home › Forums › General Issues › Get parent key instead of id › Reply To: Get parent key instead of id
That does not tell my why it is an ID in this case but it is a field or group key in a different case.
The only think I can thing of in this that it’s a field key when loaded in JSON or created in PHP and a post ID when it is loaded from the DB.
I have looked and I don’t see any simple way to convert that ID into a Key.
You can try
$field_group = acf_get_field_group($id);
$key = $field_group['key'];
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.