Support

Account

Home Forums General Issues Get field key by field name Reply To: Get field key by field name

  • There is a much easier solution given that the field exists on a given post, which you already seems to assume with your current code.

    
    $field = get_field_object('listing_type');
    $field_key = $field['key'];
    

    Done.