mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-19 09:05:22 +01:00
90fc694201
git-svn-id: http://svn.automattic.com/wordpress/trunk@3384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
35 lines
1.3 KiB
PHP
35 lines
1.3 KiB
PHP
<?php
|
|
require_once('../wp-config.php');
|
|
|
|
register_shutdown_function('execute_all_pings');
|
|
//execute_all_pings();
|
|
|
|
function execute_all_pings() {
|
|
global $wpdb;
|
|
// Do pingbacks
|
|
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")) {
|
|
$wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$ping->ID} AND meta_key = '_pingme';");
|
|
pingback($ping->post_content, $ping->ID);
|
|
echo "Pingback: $ping->post_title : $ping->ID<br/>";
|
|
}
|
|
// Do Enclosures
|
|
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")) {
|
|
$wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$enclosure->ID} AND meta_key = '_encloseme';");
|
|
do_enclose($enclosure->post_content, $enclosure->ID);
|
|
echo "Enclosure: $enclosure->post_title : $enclosure->ID<br/>";
|
|
}
|
|
// Do Trackbacks
|
|
$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.');
|
|
|
|
?>
|