[wp-trac] [WordPress Trac] #26862: WordPress fires wp_insert_action on every single save and not just when the post is created

WordPress Trac noreply at wordpress.org
Sat Jan 18 03:25:53 UTC 2014


#26862: WordPress fires wp_insert_action on every single save and not just when the
post is created
----------------------------+----------------------
 Reporter:  chriscarvache   |       Owner:
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:
Component:  Administration  |     Version:
 Severity:  normal          |  Resolution:  invalid
 Keywords:                  |
----------------------------+----------------------
Changes (by dd32):

 * status:  new => closed
 * resolution:   => invalid
 * version:  3.8 =>
 * component:  Build Tools => Administration
 * milestone:  Awaiting Review =>


Comment:

 `wp_insert_post` will be fired on every time a post object is added to the
 DB, be this from a audit / logging plugin, or from the saving process of
 WordPress.
 Autosaves and revisions will also insert posts, which is probably what
 you're seeing here.

 Some documentation to check out:
 http://codex.wordpress.org/Plugin_API/Action_Reference/wp_insert_post
 http://codex.wordpress.org/Plugin_API/Action_Reference/save_post
 (especially the examples)

 If that still doesn't help you, please try the Support Forums for support:
 http://wordpress.org/support/

--
Ticket URL: <https://core.trac.wordpress.org/ticket/26862#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list