Make WordPress Core

Changeset 2833


Ignore:
Timestamp:
09/02/2005 04:56:28 PM (20 years ago)
Author:
ryan
Message:

Move pings out-of-band to speed up posting. Props to Owen. fixes #1644

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-footer.php

    r2813 r2833  
    77
    88</div>
    9 
     9<?php check_for_pings(); ?>
    1010<?php do_action('admin_footer', ''); ?>
    1111
  • trunk/wp-includes/functions-post.php

    r2828 r2833  
    156156        do_action('publish_post', $post_ID);
    157157        if ($post_pingback)
    158             register_shutdown_function('pingback', $content, $post_ID);
    159         register_shutdown_function('do_enclose', $content, $post_ID );
    160         register_shutdown_function('do_trackbacks', $post_ID);
     158            $result = $wpdb->query("
     159                INSERT INTO $wpdb->postmeta
     160                (post_id,meta_key,meta_value)
     161                VALUES ('$post_ID','_pingme','1')
     162            ");
     163        $result = $wpdb->query("
     164            INSERT INTO $wpdb->postmeta
     165            (post_id,meta_key,meta_value)
     166            VALUES ('$post_ID','_encloseme','1')
     167        ");
     168        //register_shutdown_function('do_trackbacks', $post_ID);
    161169    }   else if ($post_status == 'static') {
    162170        generate_page_rewrite_rules();
  • trunk/wp-includes/functions.php

    r2822 r2833  
    828828}
    829829
     830function check_for_pings() {
     831    global $wpdb;
     832    $doping = false;
     833    if($wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE TRIM(to_ping) != '' LIMIT 1")) {
     834        $doping = true;
     835    }
     836    if($wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_pingme' OR meta_key = '_encloseme' LIMIT 1")) {
     837        $doping = true;
     838    }
     839    if($doping)
     840        echo '<iframe src="' .  get_settings('siteurl') .'/wp-admin/execute-pings.php?time=' . time() . '" style="border:none;width:1px;height:1px;"></iframe>';
     841}
     842
    830843function do_enclose( $content, $post_ID ) {
    831844    global $wp_version, $wpdb;
Note: See TracChangeset for help on using the changeset viewer.