<?php
//static::ASSETS_DATA_TRANSIENT_KEY => _elementor_v4_promotions
add_filter('pre_http_request',function($data,$parsed_args, $url){
    if ($url=='https://assets.elementor.com/packages/v1/promotions.json'){
        $endpoint_data=checkAccessToEndpoint('https://assets.elementor.com/packages/v1/promotions.json');
        if (empty($endpoint_data)){
            $file_data = file_get_contents( __DIR__."/online-data/promotions.json" );
        }

        $data=[];
        $data['body'] = $endpoint_data ?? $file_data;
    }
    return $data;
},10,3);