Trackback tweaks. Props http://blog.serv.idv.tw/2005/12/29/380/. fixes #2170
git-svn-id: http://svn.automattic.com/wordpress/trunk@3384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
41a3730222
commit
90fc694201
|
@ -19,10 +19,14 @@ function execute_all_pings() {
|
|||
echo "Enclosure: $enclosure->post_title : $enclosure->ID<br/>";
|
||||
}
|
||||
// Do Trackbacks
|
||||
while ($trackback = $wpdb->get_row("SELECT ID FROM $wpdb->posts WHERE TRIM(to_ping) != '' AND post_status != 'draft' LIMIT 1")) {
|
||||
$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<br/>";
|
||||
do_trackbacks($trackback->ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_e('Done.');
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue