Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

360zen on "How to force Tiny_MCE links to be relative"

$
0
0

Hi there,
I am in the process of setting up a WordPress installation that appears at two domains (i.e. http://example1.com and http://example2.com). I have managed to figure out how to switch the theme and the Site URL based on the SERVER_NAME. However, one of the few remaining problems is that links to existing content added by an user through the WYSIWYG editor still get the current site root added to them. So, if I am logged in to example1.com and add a link to an internal page through the "Existing Content" feature, "http://example1.com/" is appended to the beginning of the URL.

So, my question is, how do I stop this behavior? I would really like internal links to be relative to the Site URL of the visitor, not the Site URL of the author.

I have looked at two plugins (Relative URL and Root Relative URLs) and both of them are too broad. They change every URL on the site, which I don't need.

I've tried adding this to my functions.php, with no success:

function my_mce_setup( $init_array ) {
	$init_array['convert_urls'] = 'false';
	$init_array['relative_urls'] = 'true';

	return $init_array;
}
add_filter( 'tiny_mce_before_init', 'my_mce_setup' );

I'm assuming I'm missing something about how Tiny MCE settings are passed...
EDIT: I'm also not sure that the "Link to Existing Content" feature is even related to Tiny MCE.

Before you reply, please understand that I already know that I'm stretching WordPress beyond what it is "intended" to do. I'm aware that WordPress is designed to only support absolute URLs, but I still need a solution.

Thanks in advance for any help!

-Justin


Viewing all articles
Browse latest Browse all 8245

Trending Articles