Changeset 4077
- Timestamp:
- 08/07/2006 03:50:55 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-cron.php
r3636 r4077 8 8 9 9 $crons = get_option('cron'); 10 if (!is_array($crons) || array_shift(array_keys($crons)) > time()) 10 $keys = array_keys($crons); 11 if (!is_array($crons) || $keys[0] > time()) 11 12 return; 12 13 foreach ($crons as $timestamp => $cronhooks) { -
trunk/wp-includes/cron.php
r3931 r4077 51 51 52 52 function wp_clear_scheduled_hook( $hook ) { 53 while ( $timestamp = wp_next_scheduled( $hook ) ) 53 $args = array_slice( func_get_args(), 1 ); 54 55 while ( $timestamp = wp_next_scheduled( $hook, $args ) ) 54 56 wp_unschedule_event( $timestamp, $hook ); 55 57 } 56 58 57 function wp_next_scheduled( $hook ) {59 function wp_next_scheduled( $hook, $args = '' ) { 58 60 $crons = get_option( 'cron' ); 59 61 if ( empty($crons) ) 60 62 return false; 61 63 foreach ( $crons as $timestamp => $cron ) 62 if ( isset( $cron[$hook] ) ) 63 return $timestamp; 64 if ( isset( $cron[$hook] ) ) { 65 if ( empty($args) ) 66 return $timestamp; 67 if ( $args == $cron[$hook]['args'] ) 68 return $timestamp; 69 } 64 70 return false; 65 71 } … … 93 99 94 100 $keys = array_keys( $crons ); 95 if ( array_shift( $keys )> time() )101 if ( $keys[0] > time() ) 96 102 return; 97 103 -
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.