I am using Wordpress 3.1 with MU enabled and have a tricky issue with XMLHttpRequest. I appreciate your help.
I came across an error while using a popular plugin called Styles with Shortcodes:
The plugin adds a new icon to the editor toolbar which allows you to insert shortcodes. However, one of the buttons "Insert Shortcode" is missing.
Chrome's Inspector reveals the following error:
XMLHttpRequest cannot load http://blog1.mydomain.tld/wp-content/plugins/styles-with-shortcodes/api/admin.mce_list_fields2.php
Origin http://blog1.tld is not allowed by Access-Control-Allow-Origin.
I am using Domain Mapping to map blog1.tld to http://blog1.mydomain.tld.
This error only comes up when I access the admin using: http://blog1.tld/wp-admin/
If I access the admin using http://blog1.mydomain.tld/wp-admin the plugin works correctly.
Option 1) Pass a Access-Control-Allow-Origin header.
I don't like this approach because I am not sure of the security implications for my website and the impact it will that have for Wordpress 3.1??
Option 2) Modify the plugin to call the correct URL.
If I log into the admin using http://blog1.tld/wp-admin/ OR http://blog1.mydomain.tld/wp-admin it should call the resource from the correct domain name (http://blog1.tdl OR http://blog1.mydomain.tld respectively). What wordpress variable should I call to get the correct domain name?
Option 3) It would be helpful if I could specify in Domain Manager the admin url - that it, http://blog1.tld/wp-admin/ and http://blog1.mydomain.tld/wp-admin should always redirect to http://blog1.mydomain.tld/wp-admin