Get custom field value from the function.php

Found a solution:

add_filter( 'facetwp_preload_url_vars', function( $url_vars ) {
        //get the id of the current page
        $url="http://" . $_SERVER[ 'HTTP_HOST' ] . $_SERVER[ 'REQUEST_URI' ];
        $current_post_id = url_to_postid( $url );

        //get the offer_type (custom field) from the current page id
        $offer_id = get_field('offer_type', $current_post_id); //returns an id
        
        //get the taxonomy slug from the offer_id
        $term = get_term( $offer_id, $taxonomy );
        $slug = $term->slug;

        //preselect the offer_type facet
        if ( empty( $url_vars['offer_type'] ) ) {
            if($slug) {
                $url_vars['offer_type'] = [$slug];
            }
        }
        return $url_vars;
} );