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 |
---|---|
2972 | * @param object $post Object type containing the post information |
2973 | */ |
2974 | function _transition_post_status($new_status, $old_status, $post) { |
2975 | global $wpdb; |
2976 |
|
2977 | if ( $old_status != 'publish' && $new_status == 'publish' ) { |
2978 | // Reset GUID if transitioning to publish and it is empty |
2979 | if ( '' == get_the_guid($post->ID) ) |
2980 | $wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post->ID ) ), array( 'ID' => $post->ID ) ); |
2981 | do_action('private_to_published', $post->ID); // Deprecated, use private_to_publish |
2982 | } |
2983 |
|
2984 | // Always clears the hook in case the post status bounced from future to draft. |
2985 | wp_clear_scheduled_hook('publish_future_post', $post->ID); |
2986 | } |
2987 |
|
2988 | /** |
2989 | * _future_post_hook() - Hook used to schedule publication for a post marked for the future. |
2990 | * |