Changeset 4077 for trunk/wp-includes/post.php
- Timestamp:
- 08/07/2006 03:50:55 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r4074 r4077 497 497 498 498 // Get the basics. 499 $post_content = apply_filters('content_save_pre', $post_content); 500 $post_excerpt = apply_filters('excerpt_save_pre', $post_excerpt); 501 $post_title = apply_filters('title_save_pre', $post_title); 502 $post_category = apply_filters('category_save_pre', $post_category); 503 $post_status = apply_filters('status_save_pre', $post_status); 504 $post_name = apply_filters('name_save_pre', $post_name); 505 $comment_status = apply_filters('comment_status_pre', $comment_status); 506 $ping_status = apply_filters('ping_status_pre', $ping_status); 499 if ( empty($no_filter) ) { 500 $post_content = apply_filters('content_save_pre', $post_content); 501 $post_excerpt = apply_filters('excerpt_save_pre', $post_excerpt); 502 $post_title = apply_filters('title_save_pre', $post_title); 503 $post_category = apply_filters('category_save_pre', $post_category); 504 $post_status = apply_filters('status_save_pre', $post_status); 505 $post_name = apply_filters('name_save_pre', $post_name); 506 $comment_status = apply_filters('comment_status_pre', $comment_status); 507 $ping_status = apply_filters('ping_status_pre', $ping_status); 508 } 507 509 508 510 // Make sure we set a valid category … … 545 547 $post_date_gmt = get_gmt_from_date($post_date); 546 548 } 547 549 548 550 if ( 'publish' == $post_status ) { 549 551 $now = gmdate('Y-m-d H:i:59'); … … 659 661 660 662 if ($post_status == 'publish' && $post_type == 'post') { 661 wp_publish_post($post_ID); 663 do_action('publish_post', $post_ID); 664 665 if ( !defined('WP_IMPORTING') ) { 666 if ( $post_pingback ) 667 $result = $wpdb->query(" 668 INSERT INTO $wpdb->postmeta 669 (post_id,meta_key,meta_value) 670 VALUES ('$post_ID','_pingme','1') 671 "); 672 $result = $wpdb->query(" 673 INSERT INTO $wpdb->postmeta 674 (post_id,meta_key,meta_value) 675 VALUES ('$post_ID','_encloseme','1') 676 "); 677 wp_schedule_single_event(time(), 'do_pings'); 678 } 662 679 } else if ($post_type == 'page') { 663 680 wp_cache_delete('all_page_ids', 'pages'); … … 673 690 674 691 if ( 'future' == $post_status ) { 692 wp_clear_scheduled_hook('publish_future_post', $post_ID); 675 693 wp_schedule_single_event(mysql2date('U', $post_date), 'publish_future_post', $post_ID); 676 694 } … … 723 741 724 742 function wp_publish_post($post_id) { 725 global $wpdb;726 727 743 $post = get_post($post_id); 728 744 … … 730 746 return; 731 747 732 if ( 'publish' != $post->post_status ) 733 $wpdb->query("UPDATE IGNORE $wpdb->posts SET post_status = 'publish' WHERE ID = $post_id"); 734 735 do_action('publish_post', $post_id); 736 737 if ( defined('WP_IMPORTING') ) 748 if ( 'publish' == $post->post_status ) 738 749 return; 739 750 740 $post_pingback = get_option('default_pingback_flag'); 741 if ( $post_pingback ) 742 $result = $wpdb->query(" 743 INSERT INTO $wpdb->postmeta 744 (post_id,meta_key,meta_value) 745 VALUES ('$post_ID','_pingme','1') 746 "); 747 748 $result = $wpdb->query(" 749 INSERT INTO $wpdb->postmeta 750 (post_id,meta_key,meta_value) 751 VALUES ('$post_ID','_encloseme','1') 752 "); 753 754 wp_schedule_single_event(time(), 'do_pings'); 751 return wp_update_post(array('post_status' => 'publish', 'ID' => $post_id, 'no_filter' => true)); 755 752 } 756 753
Note: See TracChangeset
for help on using the changeset viewer.