[wp-hackers] Inconsistency with _wp_attached_file

Fong Li Heng fonglh at gmail.com
Mon Apr 4 15:14:41 UTC 2011


I'm trying to create a custom upload form for a custom post type. It works
great on the main site, and the values for the _wp_attached_file keys are
all in the year/month/filename format.

I'm using multisite on WordPress 3.1 and when I tried to do the same thing
on a subsite, the values of _wp_attached_file now contain the full URL to
the file.

So when I use wp_get_attachment_url() to retrieve the URL, the URL is wrong
because the domain is repeated twice.

I could filter the output but that seems like a hack. The behavior should be
consistent regardless of whether it's the main site or a subsite.

Where should I start looking to figure out why subsites get the full URL as
the value for the _wp_attached_file key?


More information about the wp-hackers mailing list