Complete the code to specify the CDN URL in the WordPress configuration.
define('CDN_URL', '[1]');
The CDN URL must be a valid HTTPS URL pointing to the CDN domain.
Complete the code to enqueue a CSS file from the CDN in WordPress.
wp_enqueue_style('theme-style', [1] . 'style.css');
To load assets from the CDN, use the CDN_URL constant followed by the file path.
Fix the error in the code to rewrite asset URLs to use the CDN in WordPress.
function rewrite_asset_url($url) {
return preg_replace('/^[1]/', CDN_URL, $url);
}The regex must match the full original URL prefix to replace it with the CDN URL.
Fill both blanks to correctly filter WordPress content URLs to use the CDN.
add_filter('the_content', function($content) { return str_replace([1], [2], $content); });
Replace the original site upload URL with the CDN upload URL in content.
Fill all three blanks to configure WordPress to serve static assets from the CDN.
$cdn_assets = [
'[1]',
'[2]',
'[3]'
];Common static asset directories to serve via CDN include uploads, js, and themes.
