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
167
168      // Set GUID
169      if ( ! $update )
170           $wpdb->query("UPDATE $wpdb->posts SET guid = '" . get_permalink($post_ID) . "' WHERE ID = '$post_ID'");
171
172      if ( $update) {
173           if ($previous_status != 'publish' && $post_status == 'publish') {
174                // Reset GUID if transitioning to publish.
175                $wpdb->query("UPDATE $wpdb->posts SET guid = '" . get_permalink($post_ID) . "' WHERE ID = '$post_ID'");
176                do_action('private_to_published', $post_ID);
177           }
178           
179           do_action('edit_post', $post_ID);
180      }
181
182      if ($post_status == 'publish') {
183           do_action('publish_post', $post_ID);
184
185           if ( !defined('WP_IMPORTING') ) {