diff --git a/wp-admin/execute-pings.php b/wp-admin/execute-pings.php index e68f76cb55..d6b088055d 100644 --- a/wp-admin/execute-pings.php +++ b/wp-admin/execute-pings.php @@ -19,9 +19,13 @@ function execute_all_pings() { echo "Enclosure: $enclosure->post_title : $enclosure->ID
"; } // Do Trackbacks - while ($trackback = $wpdb->get_row("SELECT ID FROM $wpdb->posts WHERE TRIM(to_ping) != '' AND post_status != 'draft' LIMIT 1")) { - echo "Trackback : $trackback->ID
"; - do_trackbacks($trackback->ID); + $trackbacks = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE TRIM(to_ping) != '' AND post_status != 'draft'"); + + if (is_array($trackbacks) && count($trackbacks)) { + foreach ($trackbacks as $trackback ) { + echo "Trackback : $trackback->ID
"; + do_trackbacks($trackback->ID); + } } } diff --git a/wp-includes/functions-post.php b/wp-includes/functions-post.php index f9d036fada..2eb3a0d375 100644 --- a/wp-includes/functions-post.php +++ b/wp-includes/functions-post.php @@ -697,8 +697,11 @@ function do_trackbacks($post_id) { $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = $post_id"); $to_ping = get_to_ping($post_id); $pinged = get_pung($post_id); - if ( empty($to_ping) ) + if ( empty($to_ping) ) { + $wpdb->query("UPDATE $wpdb->posts SET to_ping = '' WHERE ID = '$post_id'"); return; + } + if (empty($post->post_excerpt)) $excerpt = apply_filters('the_content', $post->post_content); else