[wp-hackers] Re: [wp-svn] [2647] trunk/wp-admin: Consolidate post creation code into wp_insert_post().

Ryan Boren ryan at boren.nu
Sun Jun 19 01:44:07 GMT 2005


On Sat, 2005-06-18 at 17:45 -0500, Robert Deaton wrote:
> A bit of redudnacy you may want to fix:
>  
>  	// Set GUID
>  	$wpdb->query("UPDATE $wpdb->posts SET guid = '" . get_permalink($post_ID) . "' WHERE ID = '$post_ID'");
>  	
>  	wp_set_post_cats('', $post_ID, $post_category);
> 
> 
> 	$wpdb->query("UPDATE $wpdb->posts SET guid = '" . get_permalink($post_ID) . "' WHERE ID = '$post_ID'");
> 
> Really need to set the guid twice?

Nope.  Cut-and-paste error.  Fixed in 2650.

http://trac.wordpress.org/changeset/2650

2650 also consolidates the post edit code.  Over 300 lines eliminated
from post.php.  We can probably knock another 100 off of that.



More information about the wp-hackers mailing list