Skip to content

Instantly share code, notes, and snippets.

@hasinhayder
Created July 1, 2014 13:47
Show Gist options
  • Save hasinhayder/1e0f7bb23c8a2fdb3920 to your computer and use it in GitHub Desktop.
Save hasinhayder/1e0f7bb23c8a2fdb3920 to your computer and use it in GitHub Desktop.
Replace uploaded image urls by CDN
<?php
function change_to_cdn_url() {
return 'http://your.cdn.url/wp-content/uploads';
}
add_filter( 'pre_option_upload_url_path', 'change_to_cdn_url' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment