<?php
/**
* Filter's the URL Elementor uses for enqueuing generated assets
*
* @author Landon Otis
*/
add_filter( 'set_url_scheme', function ( $url, $scheme, $orig_scheme ) {
if ( preg_match( "/elementor\/css/", $url ) ) {
if ( defined( 'UPLOAD_URL_PATH' ) ) {
$home = get_home_url();
$url = str_replace( UPLOAD_URL_PATH, "{$home}/wp-content/uploads", $url );
}
}
return $url;
}, 99, 3 );