WordPress.org

Make WordPress Core

Ticket #36824: 36824.4.1.patch

File 36824.4.1.patch, 2.3 KB (added by janw.oostendorp, 23 months ago)

Updated the query to include nopaging

  • wp-includes/comment.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    24462446function do_all_pings() {
    24472447        global $wpdb;
    24482448
     2449        $post_types = get_post_types( array( 'publicly_queryable' => true ) );
     2450
    24492451        // Do pingbacks
    2450         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")) {
    2451                 delete_metadata_by_mid( 'post', $ping->meta_id );
     2452        $pings = get_posts( array( 'post_type' => $post_types, 'suppress_filters' => false, 'nopaging' => true, 'meta_value' => '_pingme' ) );
     2453        foreach ( $pings as $ping ) {
     2454                delete_post_meta( $ping->ID, '_pingme' );
    24522455                pingback( $ping->post_content, $ping->ID );
    24532456        }
    24542457
    24552458        // Do Enclosures
    2456         while ($enclosure = $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 = '_encloseme' LIMIT 1")) {
    2457                 delete_metadata_by_mid( 'post', $enclosure->meta_id );
     2459        $enclosures = get_posts( array( 'post_type' => $post_types, 'suppress_filters' => false, 'nopaging' => true, 'meta_value' => '_encloseme' ) );
     2460        foreach ( $enclosures as $enclosure ) {
     2461                delete_post_meta( $enclosure->ID, '_encloseme' );
    24582462                do_enclose( $enclosure->post_content, $enclosure->ID );
    24592463        }
    24602464
    24612465        // Do Trackbacks
    2462         $trackbacks = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE to_ping <> '' AND post_status = 'publish'");
    2463         if ( is_array($trackbacks) )
    2464                 foreach ( $trackbacks as $trackback )
    2465                         do_trackbacks($trackback);
     2466        $trackbacks = get_posts( array( 'post_type' => $post_types, 'suppress_filters' => false, 'nopaging' => true, 'to_ping' => true, 'fields' => 'ids' ) );
     2467        foreach ( $trackbacks as $trackback ) {
     2468                do_trackbacks( $trackback );
     2469        }
    24662470
    24672471        //Do Update Services/Generic Pings
    24682472        generic_ping();
     
    30133017                 * @param int $comment_post_ID Post ID.
    30143018                 */
    30153019                do_action( 'comment_on_draft', $comment_post_ID );
    3016                
     3020
    30173021                if ( current_user_can( 'read_post', $comment_post_ID ) ) {
    30183022                        return new WP_Error( 'comment_on_draft', __( 'Sorry, comments are not allowed for this item.' ), 403 );
    30193023                } else {