WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#8862 closed defect (bug) (worksforme)

The delete_comment action is raised twice.

Reported by: Jehan Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.7
Component: Comments Keywords: reporter-feedback needs-patch needs-testing
Focuses: Cc:

Description

Hi,

I have a hook on a delete_comment action. When I delete a comment, it works well but... twice, though my code has clearly only one add_action hook on it.

For my problem, it is fortunately not a big issue... But it is still a bug, and maybe more annoying for other people.
It has been seen on the latest released version (2.7).

Change History (5)

comment:1 scohoust5 years ago

  • Cc wp@… added
  • Keywords reporter-feedback added

Sorry, what do you mean by deleted twice? Could you show/explain your code?

comment:2 Denis-de-Bernardy5 years ago

he's meaning that if you add an option that increments a counter when the delete_comment hook gets fired, it gets triggered twice.

it *could* be that both the "normal" delete action (through http post) and the ajax delete action get fired, else I really can't see how this can possibly occur.

comment:3 Denis-de-Bernardy5 years ago

it *would* get triggered twice, even. (haven't tested myself)

comment:4 Denis-de-Bernardy5 years ago

  • Keywords needs-patch needs-testing added
  • Milestone changed from 2.8 to Future Release

bumping to Future, as this can only have minor side effects.

comment:5 Denis-de-Bernardy5 years ago

  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from new to closed

works fine here.

Note: See TracTickets for help on using tickets.