diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-07-24 13:24:32 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-07-24 13:24:32 +0000 |
| commit | 5d34926f74d8032e4a245c01c2b35351286edd76 (patch) | |
| tree | 056b48994c2cb92704ea91ee5c6b6f46ed41e68d /wp-includes/post.php | |
| parent | 15a0a1765324cd24fba870fc10b45366f9f757ba (diff) | |
| download | wordpress-mu-5d34926f74d8032e4a245c01c2b35351286edd76.tar.gz wordpress-mu-5d34926f74d8032e4a245c01c2b35351286edd76.tar.xz wordpress-mu-5d34926f74d8032e4a245c01c2b35351286edd76.zip | |
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@703 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/post.php')
| -rw-r--r-- | wp-includes/post.php | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/wp-includes/post.php b/wp-includes/post.php index c89c552..af34198 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -652,22 +652,7 @@ function wp_insert_post($postarr = array()) { } if ($post_status == 'publish' && $post_type == 'post') { - do_action('publish_post', $post_ID); - - if ( !defined('WP_IMPORTING') ) { - if ( $post_pingback ) - $result = $wpdb->query(" - INSERT INTO $wpdb->postmeta - (post_id,meta_key,meta_value) - VALUES ('$post_ID','_pingme','1') - "); - $result = $wpdb->query(" - INSERT INTO $wpdb->postmeta - (post_id,meta_key,meta_value) - VALUES ('$post_ID','_encloseme','1') - "); - wp_schedule_single_event(time(), 'do_pings'); - } + wp_publish_post($post_ID); } else if ($post_type == 'page') { wp_cache_delete('all_page_ids', 'pages'); $wp_rewrite->flush_rules(); @@ -731,15 +716,36 @@ function wp_update_post($postarr = array()) { } function wp_publish_post($post_id) { + global $wpdb; + $post = get_post($post_id); if ( empty($post) ) return; - if ( 'publish' == $post->post_status ) + if ( 'publish' != $post->post_status ) + $wpdb->query("UPDATE IGNORE $wpdb->posts SET post_status = 'publish' WHERE ID = $post_id"); + + do_action('publish_post', $post_id); + + if ( defined('WP_IMPORTING') ) return; - return wp_update_post(array('post_status' => 'publish', 'ID' => $post_id)); + $post_pingback = get_option('default_pingback_flag'); + if ( $post_pingback ) + $result = $wpdb->query(" + INSERT INTO $wpdb->postmeta + (post_id,meta_key,meta_value) + VALUES ('$post_ID','_pingme','1') + "); + + $result = $wpdb->query(" + INSERT INTO $wpdb->postmeta + (post_id,meta_key,meta_value) + VALUES ('$post_ID','_encloseme','1') + "); + + wp_schedule_single_event(time(), 'do_pings'); } function wp_set_post_categories($post_ID = 0, $post_categories = array()) { |
