class change_URL { function change_URL() { add_action('get_header', array(&$this, 'get_header'), 1); add_action('wp_footer', array(&$this, 'wp_footer'), 99999); } function replace_URL($content) { $old_url = 'http://hoge.example.com/'; $home_url = trailingslashit(get_home_url('/')); return str_replace($old_url, $home_url, $content); } function get_header(){ ob_start(array(&$this, 'replace_URL')); }