Support

Account

Home Forums General Issues Group ID is 0

Solved

Group ID is 0

  • Hi everyone!

    I got some code that uses acf_get_fields_by_id but the group ID is 0 for groups exported as PHP and registered with acf_add_local_field_group. Is this a bug?

  • Hi @ncl

    So to be clear, this is field groups you’ve created in wp admin or with php?
    The ones you export that is.

  • i created the groups/fields in wp admin and then exported them as PHP code. The ID of every group is 0 when i use the exported code as an include. Everything works as expected when i import them via the UI. My guess is that acf_add_local_field_group doesn’t import the groups into the DB so there’s no ID.

  • Yeah,

    That’s what I’m thinking too. Since you include them directly as a file nothing is put into DB and ACF reads directly from the file thus there’s no ID.

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Group ID is 0’ is closed to new replies.