library/Helper/Acf.php
public static function getFieldKey($fieldName, $fieldId)
    {
        if (isset(get_field_objects($fieldId)[$fieldName]['key'])) {
            return get_field_objects($fieldId)[$fieldName]['key'];
        }

        return false;
    }
public static function getFieldKey($fieldName, $fieldId)
    {
        if (isset(get_field_objects($fieldId)[$fieldName]['key'])) {
            return get_field_objects($fieldId)[$fieldName]['key'];
        }

        return false;
    }
public static function getFieldKey ( $ fieldName , $ fieldId ) { if ( isset ( get_field_objects ( $ fieldId ) [ $ fieldName ] [ 'key' ] ) ) { return get_field_objects ( $ fieldId ) [ $ fieldName ] [ 'key' ] ; } return false ; }
Get ACF field key by fieldname, has to be run at action 'init' or later
@param string $fieldName The field name
@param string $fieldId Field ID can be post id, widget id, 'options' etc
@return boolean/string
Get ACF field key by fieldname has to be run at action init or later