WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 3503 | * @param object $post Object type containing the post information |
| 3504 | */ |
| 3505 | function _transition_post_status($new_status, $old_status, $post) { |
| 3506 | global $wpdb; |
| 3507 | |
| 3508 | if ( $old_status != 'publish' && $new_status == 'publish' ) { |
| 3509 | // Reset GUID if transitioning to publish and it is empty |
| 3510 | if ( '' == get_the_guid($post->ID) ) |
| 3511 | $wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post->ID ) ), array( 'ID' => $post->ID ) ); |
| 3512 | do_action('private_to_published', $post->ID); // Deprecated, use private_to_publish |
| 3513 | } |
| 3514 | |
| 3515 | // Always clears the hook in case the post status bounced from future to draft. |
| 3516 | wp_clear_scheduled_hook('publish_future_post', $post->ID); |
| 3517 | } |
| 3518 | |
| 3519 | /** |
| 3520 | * Hook used to schedule publication for a post marked for the future. |
| 3521 | * |