Throttle generic pings to no more than once per hour. Props Denis-de-Bernardy. fixes #6698
git-svn-id: http://svn.automattic.com/wordpress/trunk@11410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -3244,6 +3244,9 @@ function _transition_post_status($new_status, $old_status, $post) {
|
||||
if ( '' == get_the_guid($post->ID) )
|
||||
$wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post->ID ) ), array( 'ID' => $post->ID ) );
|
||||
do_action('private_to_published', $post->ID); // Deprecated, use private_to_publish
|
||||
// do generic pings once per hour at most
|
||||
if ( !wp_next_scheduled('do_generic_ping') )
|
||||
wp_schedule_single_event(time() + 3600, 'do_generic_ping');
|
||||
}
|
||||
|
||||
// Always clears the hook in case the post status bounced from future to draft.
|
||||
|
||||
Reference in New Issue
Block a user