Home Forums General Issues Retrive field_key outside the loop Reply To: Retrive field_key outside the loop

  • As far as I know there isn’t a way to get a field object by the field name when there is nothing already in the database for that field.

    Instead of using the field name in get_field_object, use the field key, or in this case, just hard code the field key for that field.

    In ACF, multiple fields can have the same name. ACF does not know which field to get unless it can get the key form the database for whatever object the field is attached to, like a post or term or options.