From db2bd867dbfbb1562248279663851676a8da1ba3 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sat, 31 Dec 2005 21:24:56 +0000 Subject: [PATCH] Trackback tweaks. Props http://blog.serv.idv.tw/2005/12/29/380/. fixes #2170 git-svn-id: https://develop.svn.wordpress.org/trunk@3384 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/execute-pings.php | 10 +++++++--- wp-includes/functions-post.php | 5 ++++- 2 files changed, 11 insertions(+), 4 deletions(-) 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