Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: private_to_published

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
3103  * @param object $post Object type containing the post information
3104  */
3105 function _transition_post_status($new_status, $old_status, $post) {
3106      global $wpdb;
3107
3108      if ( $old_status != 'publish' && $new_status == 'publish' ) {
3109           // Reset GUID if transitioning to publish and it is empty
3110           if ( '' == get_the_guid($post->ID) )
3111                $wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post->ID ) ), array( 'ID' => $post->ID ) );
3112           do_action('private_to_published', $post->ID);  // Deprecated, use private_to_publish
3113      }
3114
3115      // Always clears the hook in case the post status bounced from future to draft.
3116      wp_clear_scheduled_hook('publish_future_post', $post->ID);
3117 }
3118
3119 /**
3120  * Hook used to schedule publication for a post marked for the future.
3121  *