diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-09-14 09:23:07 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-09-14 09:23:07 +0000 |
| commit | 2ef27708de0ba744d023d4c5199531303ffe0c36 (patch) | |
| tree | ec43ca488ec3d7a14e3a31cf7de8015bf95c9a5b /wp-inst/wp-includes/functions-post.php | |
| parent | 3745afdd70424105c8734b0144aa943de7629a28 (diff) | |
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@324 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-includes/functions-post.php')
| -rw-r--r-- | wp-inst/wp-includes/functions-post.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/wp-inst/wp-includes/functions-post.php b/wp-inst/wp-includes/functions-post.php index b0167dd..824cf30 100644 --- a/wp-inst/wp-includes/functions-post.php +++ b/wp-inst/wp-includes/functions-post.php @@ -134,20 +134,24 @@ function wp_insert_post($postarr = array()) { } $result = $wpdb->query($postquery); - if ( $update ) - $rval = $wpdb->rows_affected; - else - $rval = $wpdb->insert_id; + + wp_set_post_cats('', $post_ID, $post_category); + + if ( 'static' == $post_status ) + clean_page_cache($post_ID); + else + clean_post_cache($post_ID); // Set GUID if ( ! $update ) $wpdb->query("UPDATE $wpdb->posts SET guid = '" . get_permalink($post_ID) . "' WHERE ID = '$post_ID'"); - - wp_set_post_cats('', $post_ID, $post_category); if ( $update) { - if ($previous_status != 'publish' && $post_status == 'publish') + if ($previous_status != 'publish' && $post_status == 'publish') { + // Reset GUID if transitioning to publish. + $wpdb->query("UPDATE $wpdb->posts SET guid = '" . get_permalink($post_ID) . "' WHERE ID = '$post_ID'"); do_action('private_to_published', $post_ID); + } do_action('edit_post', $post_ID); } |
