Skip to content

Instantly share code, notes, and snippets.

@justinph
Last active June 29, 2019 20:25
Show Gist options
  • Save justinph/5255773 to your computer and use it in GitHub Desktop.
Save justinph/5255773 to your computer and use it in GitHub Desktop.
How to find your CDN url in WordPress on WPEngine.
if (class_exists('WpeCommon')){
$wpe_common = new WpeCommon();
$cdn_url = $wpe_common->get_cdn_domain($wpe_netdna_domains,get_bloginfo( 'url' ) );
}
var_dump($cdn_url);
@jack-fdrv
Copy link

jack-fdrv commented Jun 29, 2019

Seems doesnt work any more
https://d.pr/free/i/nFqJJD

this works:

if (class_exists('WpeCommon')){
  global $wpe_netdna_domains, $wpe_netdna_domains_secure;
  $wpe_common = new WpeCommon();
  $cdn_url = $wpe_common->get_cdn_domain($wpe_netdna_domains_secure, get_bloginfo( 'url' ), isset( $_SERVER['HTTPS'] ) );   
}   
var_dump($cdn_url);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment