[wp-hackers] Why always absolute paths?

Frank Bueltge frank at bueltge.de
Thu Apr 22 15:13:29 UTC 2010


http://wpengineer.com/wordpress-return-url/
A small post for this topic
Frank



On Thu, Apr 22, 2010 at 5:02 PM, Otto <otto at ottodestruct.com> wrote:

> On Thu, Apr 22, 2010 at 12:46 AM, Jon Brown <jbrown510 at gmail.com> wrote:
> > Is there an equivalent to <?php bloginfo('template_directory');?> that
> points to the /wp-content folder?  It seems to me that it would at least
> provide a bridge for those that need it, like me, to make moving sites
> between domains easier?
>
> In PHP, you should use the content_url() function. It works like this:
> echo content_url('temp/whatever');
>
> That will give you "http://example.com/wp-content/temp/whatever" as the
> output.
>
> There's also plugins_url, admin_url, includes_url, site_url, home_url,
> network_site_url, network_home_url, network_admin_url... These all do
> the same basic thing for different URLs that you might need. Several
> of these are new to 3.0, but many of them have been around since 2.6
> or so.
>
> -Otto
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list