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 |
|---|---|
| 2834 | * @param object $post Object type containing the post information |
| 2835 | */ |
| 2836 | function _transition_post_status($new_status, $old_status, $post) { |
| 2837 | global $wpdb; |
| 2838 | |
| 2839 | if ( $old_status != 'publish' && $new_status == 'publish' ) { |
| 2840 | // Reset GUID if transitioning to publish and it is empty |
| 2841 | if ( '' == get_the_guid($post->ID) ) |
| 2842 | $wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post->ID ) ), array( 'ID' => $post->ID ) ); |
| 2843 | do_action('private_to_published', $post->ID); // Deprecated, use private_to_publish |
| 2844 | } |
| 2845 | |
| 2846 | // Always clears the hook in case the post status bounced from future to draft. |
| 2847 | wp_clear_scheduled_hook('publish_future_post', $post->ID); |
| 2848 | } |
| 2849 | |
| 2850 | /** |
| 2851 | * _future_post_hook() - Hook used to schedule publication for a post marked for the future. |
| 2852 | * |