Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#13001 closed enhancement (invalid)

Action Hook for change post status

Reported by: angeloverona's profile Angeloverona Owned by:
Milestone: Priority: high
Severity: normal Version: 3.0
Component: General Keywords: hook action pending
Focuses: Cc:

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)

#1 @mikeschinkel
14 years ago

  • Cc mikeschinkel@… added

#2 @jamescollins
14 years ago

  • Milestone 3.0 deleted
  • Resolution set to invalid
  • Status changed from new to closed

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.

#3 @nacin
14 years ago

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.