[wp-hackers] post processing weirdness

Mark Jaquith mark.wordpress at txfx.net
Sat Jun 25 17:06:25 GMT 2005


I think this is the bug that has been plaguing WordPress and me for 
months.  You remember the bug whereby if you created a draft and then 
published, your pingbacks would be sent out with crufty ?p= URIs?  If 
you honestly fixed that bug, I owe you a beer.  I spent about 2 hours 
trying to fix that bug and failing.

- Mark

On Sat, 25 Jun 2005 11:31am, Scott Merrill wrote:
> Scott Merrill wrote:
>> This is the offending line in wp-includes/template-functions-links.php:
>> if ('' != $permalink && 'draft' != $post->post_status) {
>> What harm is there in generating a permalink for a draft post?
>> My _real_ question, though, is what is this?
>>    $post = & get_post($id);
>> Line 40 of wp-includes/template-functions-links.php.
>> I grepped for "get_post" and found several get_post_*(), and of course 
>> get_posts(); but no get_post().  Is this simply a typo, or am I 
>> missing something?
>> I suspect that the get_post() results in a no-op, leaving $post set to 
>> the global $post object, which is still marked as Draft, even though 
>> "Publish" has been set.
>
> Follow-up to myself: I have edited template-functions-links.php, and 
> replaced get_post() with get_posts().  The correct cruft-free permalink 
> is now generated.  So I guess it _is_ a simple typo, for which I'll now 
> file a bug.  =)
>
> --
> skippy at skippy.net | http://skippy.net/
>
> gpg --keyserver pgp.mit.edu --recv-keys 9CFA4B35
> 506C F8BB 17AE 8A05 0B49  3544 476A 7DEC 9CFA 4B35
> _______________________________________________
> 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