WordPress.org

Make WordPress Core

Ticket #6698: 6698.4.diff

File 6698.4.diff, 915 bytes (added by Denis-de-Bernardy, 12 years ago)

throttling with immediate pinging

  • wp-includes/post.php

     
    32753275                        $wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post->ID ) ), array( 'ID' => $post->ID ) );
    32763276                do_action('private_to_published', $post->ID);  // Deprecated, use private_to_publish
    32773277                // do generic pings once per hour at most
    3278                 if ( !wp_next_scheduled('do_generic_ping') )
    3279                         wp_schedule_single_event(time() + 3600, 'do_generic_ping');
     3278                if ( !wp_next_scheduled('do_generic_ping') && !get_transient('last_ping') ) {
     3279                        wp_schedule_single_event(time(), 'do_generic_ping');
     3280                        // return false on the transient_last_ping hook to disable throttling
     3281                        set_transient('last_ping', time(), time() + 3600);
     3282                }
    32803283        }
    32813284
    32823285        // Always clears the hook in case the post status bounced from future to draft.