I’ve noticed that in a WordPress MU install with domain mapping enabled, some functions return URIs that don’t use the current WPMU site’s primary domain name which possibly means they are “WPMU Domain Mapped-ignorant functions” (a little harsh, I know).
What can I do to ensure the primary domain of the current WPMU site is used in returned URIs when I call these kinds of functions, in an effort towards referencing assets (js, css, img, etc) in a canonical, siloed manner?
A quick example being the following:
$ft_img = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full');
So in this example $ft_img[0]
would have the same URI for every subsite in a WPMU network, using the base site’s siteurl
when it should be subsite-specific.
Since “WordPress MU is no longer under active development as a separate product“, I don’t recommend using it. Instead I recommend using the setup described in this answer. It’s highly configurable you can choose what WordPress files you want on all your WordPress sites and what you want to store separately from each other WordPress site. With this setup all the WordPress functionality will remain working just like you’re running a regular WordPress installation. Except this one is way easier to maintain, uses less disk space and can be distributed across a whole server or cloud.