WordPress.org

Make WordPress Core

Ticket #36824: 36824-pings.diff

File 36824-pings.diff, 1.0 KB (added by boonebgorges, 5 months ago)
  • src/wp-includes/comment.php

    diff --git src/wp-includes/comment.php src/wp-includes/comment.php
    index 4b192ea02e..ea4fabf1d6 100644
    function discover_pingback_server_uri( $url, $deprecated = '' ) { 
    26332633function do_all_pings() {
    26342634        global $wpdb;
    26352635
    2636         // Do pingbacks
    2637         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" ) ) {
    2638                 delete_metadata_by_mid( 'post', $ping->meta_id );
    2639                 pingback( $ping->post_content, $ping->ID );
     2636        $ping_types = get_post_types_by_support( 'trackbacks' );
     2637
     2638        // Do pingbacks.
     2639        $pings = get_posts(
     2640                array(
     2641                        'post_type'        => $ping_types,
     2642                        'suppress_filters' => false,
     2643                        'nopaging'         => true,
     2644                        'meta_key'         => '_pingme',
     2645                        'fields'           => 'ids',
     2646                )
     2647        );
     2648
     2649        foreach ( $pings as $ping ) {
     2650                delete_post_meta( $ping, '_pingme' );
     2651                pingback( null, $ping );
    26402652        }
    26412653
    26422654        // Do Enclosures