Make WordPress Core

Opened 20 years ago

Closed 20 years ago

Last modified 19 years ago

#1860 closed defect (bug) (fixed)

Add comment_count field to posts table

Reported by: donncha's profile donncha Owned by: ryan's profile ryan
Milestone: Priority: highest omg bbq
Severity: normal Version: 1.6
Component: General Keywords: comments db bg|has-patch
Focuses: Cc:

Description

Attached is a patch to add a comment_count field to the posts table.

I had to move an action hook in front of the sql that deletes a comment because you can't do anything useful with deleted data!

Hooks included for adding/deleting/editing/changing status of comments.

Attachments (1)

patch.txt (6.2 KB) - added by donncha 20 years ago.

Download all attachments as: .zip

Change History (6)

@donncha
20 years ago

#1 @ringmaster
20 years ago

Out of curiosity, what is the benefit of keeping a counter of the comments over running the query in revisions prior to this? I would guess that the tradeoff is speed, but don't you potentially lose a bit of reliability?

#2 @davidhouse
20 years ago

  • Keywords comments db bg|has-patch added

#3 @ryan
20 years ago

  • Milestone set to 1.6
  • Owner changed from anonymous to ryan

#4 @ryan
20 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [3104]) Add comment_count to the posts table. Props donncha. fixes #1860

#5 @(none)
19 years ago

  • Milestone 2.0 deleted

Milestone 2.0 deleted

Note: See TracTickets for help on using tickets.