[wp-trac] Re: [WordPress Trac] #2836: wp_delete_comment() uses
simple comment count decrementation instead of getting a fresh count
WordPress Trac
wp-trac at lists.automattic.com
Sun Jun 18 12:04:05 GMT 2006
#2836: wp_delete_comment() uses simple comment count decrementation instead of
getting a fresh count
-------------------------+--------------------------------------------------
Reporter: markjaquith | Owner: markjaquith
Type: defect | Status: assigned
Priority: normal | Milestone: 2.1
Component: General | Version: 2.0.3
Severity: normal | Resolution:
Keywords: has-patch |
-------------------------+--------------------------------------------------
Changes (by markjaquith):
* keywords: => has-patch
* status: new => assigned
Comment:
The patch for the 2.0 branch is simple: instead of blindly decrementing,
it does a fresh count, identical to the way it does in wp_insert_comment()
The patch for Trunk is a little more comprehensive. I wrote a new
function, wp_update_comment_count() which takes a post ID and does the
COUNT() and the UPDATE queries, as well as filling in an entry for the
comment count cache array. wp_insert_comment(), wp_delete_comment() and
wp_update_comment() have all been edited to use this function.
--
Ticket URL: <http://trac.wordpress.org/ticket/2836>
WordPress Trac <http://wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list