Displaying images with relative paths in the editor

I had a client ask for that and it took a little while to get it but its simple:

function change_mce_path_options( $init ) {
 $init['relative_urls'] = true;
 $init['document_base_url'] = get_bloginfo('url');
 return $init;
}
add_filter('tiny_mce_before_init', 'change_mce_path_options');

Leave a Comment