Changeset 3463
- Timestamp:
- 01/19/2006 12:03:28 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/execute-pings.php
r3384 r3463 1 1 <?php 2 2 3 require_once('../wp-config.php'); 3 4 4 register_shutdown_function('execute_all_pings'); 5 //execute_all_pings(); 5 // Do pingbacks 6 while ($ping = $wpdb->get_row("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_pingme' LIMIT 1")) { 7 $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$ping->ID} AND meta_key = '_pingme';"); 8 pingback($ping->post_content, $ping->ID); 9 } 6 10 7 function execute_all_pings() { 8 global $wpdb; 9 // Do pingbacks 10 while ($ping = $wpdb->get_row("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_pingme' LIMIT 1")) { 11 $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$ping->ID} AND meta_key = '_pingme';"); 12 pingback($ping->post_content, $ping->ID); 13 echo "Pingback: $ping->post_title : $ping->ID<br/>"; 14 } 15 // Do Enclosures 16 while ($enclosure = $wpdb->get_row("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_encloseme' LIMIT 1")) { 17 $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$enclosure->ID} AND meta_key = '_encloseme';"); 18 do_enclose($enclosure->post_content, $enclosure->ID); 19 echo "Enclosure: $enclosure->post_title : $enclosure->ID<br/>"; 20 } 21 // Do Trackbacks 22 $trackbacks = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE TRIM(to_ping) != '' AND post_status != 'draft'"); 11 // Do Enclosures 12 while ($enclosure = $wpdb->get_row("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_encloseme' LIMIT 1")) { 13 $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$enclosure->ID} AND meta_key = '_encloseme';"); 14 do_enclose($enclosure->post_content, $enclosure->ID); 15 } 23 16 24 if (is_array($trackbacks) && count($trackbacks)) { 25 foreach ($trackbacks as $trackback ) { 26 echo "Trackback : $trackback->ID<br/>"; 27 do_trackbacks($trackback->ID);28 }17 // Do Trackbacks 18 $trackbacks = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE CHAR_LENGTH(TRIM(to_ping)) > 7 AND post_status != 'draft'"); 19 if ( is_array($trackbacks) ) { 20 foreach ( $trackbacks as $trackback ) { 21 do_trackbacks($trackback->ID); 29 22 } 30 23 } 31 24 32 _e('Done.');33 34 25 ?>
Note: See TracChangeset
for help on using the changeset viewer.