WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4740 closed enhancement (fixed)

New action for wp_update_comment_count()

Reported by: mdawaffe Owned by:
Milestone: 2.3 Priority: normal
Severity: normal Version: 2.2.2
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

wp_update_comment_count() calls the edit_post action (with different parameters than does the wp_insert_post() function), but this action doesn't receive information on how and if the count changed.

Knowing this information would be useful to advanced caching systems, plugins that do fancy things with plugins/pings, and surely a buch of stuff I can't think of.

I propose a new hook:

do_action('wp_update_comment_count', $post_id, $new_count, $old_count);

Attached makes that happen and gives the edi_post hook the same parameters as it has in wp_insert_post().

Attachments (1)

4740.diff (1.3 KB) - added by mdawaffe 7 years ago.

Download all attachments as: .zip

Change History (3)

mdawaffe7 years ago

comment:1 ryan7 years ago

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

(In [5869]) wp_update_comment_count hook from mdawaffe. fixes #4740

comment:2 foolswisdom7 years ago

  • Milestone changed from 2.4 (future) to 2.3 (trunk)
Note: See TracTickets for help on using tickets.