Make WordPress Core

Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#3908 closed defect (bug) (wontfix)

Leaving comment (on page) causes 'edit post' hook to run

Reported by: YellowSwordfish Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.1.1
Component: General Keywords:
Focuses: Cc:

Description (last modified by markjaquith)

If you have a page with comments open and a plugin that uses the 'edit post' hook, the hook is being actioned when someone leaves a comment.

No milestone until we reach a conclusion on what (if anything) to do.

Change History (8)

#1 @markjaquith
9 years ago

  • Description modified (diff)
  • Milestone 2.3 deleted

The reason for this is that the post's comment_count is updated.

Not saying that it should definitely be so; just adding some background.

#2 @YellowSwordfish
9 years ago

The problem comes with plugins using the hook that get fired. Surely the hook should only really be fired if the actual content is changed...

#3 @ryan
9 years ago

Some plugins rely on that being fired for any change to the post object. We might need separate actions.

#4 follow-up: @jhodgdon
9 years ago

The current behavior is at least now documented in the Codex's New And Improved List Of Action Hooks. http://codex.wordpress.org/Plugin_API/Action_Reference

It is not that hard for a plugin to verify what is being updated and do the right thing, either.

I am in favor of leaving the existing behavior.

#5 in reply to: ↑ 4 @YellowSwordfish
9 years ago

Replying to jhodgdon:

It is not that hard for a plugin to verify what is being updated and do the right thing, either.

Can you suggest a way? The code is sitting there waiting for the edit_post to be fired and all it receives is the id. How do I tell what just got changed? The change was nothing to do with me or my plugin?

#6 @Nazgul
8 years ago

  • Milestone set to 2.4 (future)

#7 @ryan
8 years ago

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

This has been the behavior for awhile now, so closing.

#8 @Nazgul
8 years ago

  • Milestone 2.5 deleted
Note: See TracTickets for help on using tickets.