リンク http://からの絶対URLから、サーバルートからのパスに変更

完全な相対URLではないですが、ルートからのパスに変換する Wordpress関数

$link= 'http://www.tenman.info/images/pen.jpg';
echo "<a href=".wp_make_link_relative( $link ).">test1</a>";

//result: <a href="/images/pen.jpg" rel="noreferrer">test1</a>

戻してみる

	function my_rel2abs_url( $content ){
		$url= parse_url( home_url() );
		return str_replace( 
			array('src="/','href="/')
 		,array(	'src="'.$url['scheme'].'://'.$url['host'] .'/'
 		, 'href="'.$url['scheme'].'://'.$url['host'] .'/' 
 		)
 	,$content);
	}

[emulsion_relate_posts]