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.

  • I use wp_get_attachment_image_src in a domain-mapped mu setup without issue, it returns the correct URI for main as well as all sub-sites. Maybe I'm not understanding what you're after? – Milo Jun 2 '13 at 2:49
  • @Milo: Odd, that's what I'm after but I get the main site's primary domain in URI for all sub-sites too. I wonder what I'm doing wrong. – Marcel Jun 2 '13 at 6:47

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.