Use WP_Query when sending pingbacks.

Props dshanske, spacedmonkey, janw.oostendorp, mrmadhat, birgire.
See #36824.

git-svn-id: https://develop.svn.wordpress.org/trunk@46177 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges 2019-09-19 01:59:06 +00:00
parent daa1da924d
commit 3419633de4

View File

@ -2633,10 +2633,20 @@ function discover_pingback_server_uri( $url, $deprecated = '' ) {
function do_all_pings() {
global $wpdb;
// Do pingbacks
while ( $ping = $wpdb->get_row( "SELECT ID, post_content, meta_id FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_pingme' LIMIT 1" ) ) {
delete_metadata_by_mid( 'post', $ping->meta_id );
pingback( $ping->post_content, $ping->ID );
// Do pingbacks.
$pings = get_posts(
array(
'post_type' => get_post_types(),
'suppress_filters' => false,
'nopaging' => true,
'meta_key' => '_pingme',
'fields' => 'ids',
)
);
foreach ( $pings as $ping ) {
delete_post_meta( $ping, '_pingme' );
pingback( null, $ping );
}
// Do enclosures.