选择页面
//将本地图片地址替换为CDN地址
define('CDN_HOST','//www.wanvi.net');
add_filter('the_content','z_cdn_content');
function z_cdn_content($content){
  return str_replace(home_url().'/wp-content/uploads', CDN_HOST.'/wp-content/uploads', $content);
  }
  add_filter('wp_get_attachment_url','z_get_attachment_url',10,2);
function z_get_attachment_url($url, $post_id){
  return str_replace(home_url(), CDN_HOST, $url);
  }