Ready to get started?Download WordPress


Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Action Reference/wp insert post

The wp_insert_post action is called with the same parameters as the save_post action (the post ID for the post being created), but is only called for new posts and only after save_post has run. Please see Plugin_API/Action_Reference/save_post for more information. Keep in mind that this action is called both for actions in the admin as well as anytime the wp_insert_post() function is invoked.

This action can be replicated by creating a conditional in a save_post action that excludes certain post statuses.




This page is marked as incomplete. You can help Codex by expanding it.