[wp-hackers] absolute URLs in plug-ins and custom types

Shasta Willson shastaw at gmail.com
Wed Jul 4 21:54:27 UTC 2012


On Wed, Jul 4, 2012 at 12:55 PM, Otto <otto at ottodestruct.com> wrote:
>
>> Uh..no..that's what relative URLs are specifically for.
>
> So, a URL of /2012/07/whatever will still work when you move it to
> /blog/2012/07/whatever? (Hint: nope.)

I'm not using the terms properly.  When I said "relative", I really
meant I code something like this:

<a href="<?php bloginfo('url') ?>/whatever">

Which is NOT a relative URL once rendered, but does update if I change
the site settings, as opposed to the plug-ins which require you to
input a URL like this:

http://testsite.com/wp-content/uploads/2012/01/cover.jpg

Now that I understand there are other things that are absolute AND
thanks to Bill I understand why I've had trouble with prior DB search
and replace operations, it makes sense that that's the right way to
handle moves. I rarely work with moving live content, but recently had
a site with posts and thought I'd done something wrong when I had to
fix all the images.

Thanks folks!
Shasta


More information about the wp-hackers mailing list