#13001 closed enhancement (invalid)
Action Hook for change post status
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | General | Version: | 3.0 |
| Severity: | normal | Keywords: | hook action pending |
| Cc: | mikeschinkel@… |
Description
We have post_publish hook to action of publish, but it more as needed, also hooks for pending for example to handle action after the button "submit to review" is pressed. Or post is saved as a draft.
Change History (3)
comment:1
mikeschinkel — 3 years ago
- Cc mikeschinkel@… added
comment:2
jamescollins — 3 years ago
- Milestone 3.0 deleted
- Resolution set to invalid
- Status changed from new to closed
2616 function wp_transition_post_status($new_status, $old_status, $post) {
2617 do_action('transition_post_status', $new_status, $old_status, $post);
2618 do_action("{$old_status}_to_$new_status", $post);
2619 do_action("{$new_status}_$post->post_type", $post->ID, $post);
2620 }
Note: See
TracTickets for help on using
tickets.

I suggest you take a look at the wp_transition_post_status() function and associated transition_post_status hook in wp-includes/post.php.
This hook allows you to see the new status, the old status, and the post data.