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