WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 6 years ago

Last modified 6 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)

comment:1 markjaquith7 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.

comment:2 YellowSwordfish7 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...

comment:3 ryan7 years ago

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

comment:4 follow-up: jhodgdon7 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.

comment:5 in reply to: ↑ 4 YellowSwordfish7 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?

comment:6 Nazgul7 years ago

  • Milestone set to 2.4 (future)

comment:7 ryan6 years ago

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

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

comment:8 Nazgul6 years ago

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