#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 )
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)
#2
@
17 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
@
17 years ago
Some plugins rely on that being fired for any change to the post object. We might need separate actions.
#4
follow-up:
↓ 5
@
17 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
@
17 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?
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.