[wp-hackers] update $wp_query->post->guid fails

Will Anderson will at itsananderson.com
Fri Jul 9 19:23:54 UTC 2010


Is there a reason why the URL is used? From a GUID definition standpoint,
the post's address meets the criteria (it should be globally unique [1]),
but from a user's standpoint, it has a lot of potential for confusion for
people who are (a) new to the WP DB and (b) don't already know what a GUID
is.

I guess what it boils down to is, why isn't something like the PHP uniqid()
function [2] used instead?

[1] http://en.wikipedia.org/wiki/Globally_Unique_Identifier
<http://en.wikipedia.org/wiki/Globally_Unique_Identifier>[2]
http://www.php.net/manual/en/function.uniqid.php
<http://www.php.net/manual/en/function.uniqid.php>

On Fri, Jul 9, 2010 at 12:14 PM, Otto <otto at ottodestruct.com> wrote:

> The GUID field never changes. It's not the current permalink of the
> post, it's a unique identifier for that post. If you make the post
> somewhere and then import the post to a new place, the GUID field will
> remain the same.
>
> Yes, it's set to be a link to the post at the time of creation, but
> it's not a "link", really. It's a unique identifier.
>
> -Otto
>
>
>
> On Fri, Jul 9, 2010 at 2:05 PM, 24/7 <24-7 at gmx.net> wrote:
> > Hi list members,
> >
> > i imported test/example posts some time ago. Today i checked the
> > following:
> >
> > [code]
> > global $wp_query;
> > $test_me = $wp_query->post->guid;
> > echo $test_me;
> > [/code]
> >
> > The result was http://dev.*****.com/dan/wordpress/?p=53
> >
> > I than took a look into $wpdb->table_prefix . '_posts' and found that
> > it was really stored there as the result told me. I tried saving the
> > post again, but the guid-column field stays the same.
> >
> > Am i running into a bug? Thanks!
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> 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