Changeset 1604

Show
Ignore:
Timestamp:
09/05/04 02:03:51 (4 years ago)
Author:
saxmatt
Message:

Set GUID when posting.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/post.php

    r1599 r1604  
    168168 
    169169    add_meta($post_ID); 
     170 
     171    $wpdb->query("UPDATE $wpdb->posts SET guid = '" . get_permalink($post_ID) . "' WHERE ID = '$post_ID'"); 
    170172     
    171173    if (isset($sleep_after_edit) && $sleep_after_edit > 0) { 
  • trunk/wp-includes/functions-post.php

    r1599 r1604  
    4242    $result = $wpdb->query($sql); 
    4343    $post_ID = $wpdb->insert_id; 
    44      
    45     wp_set_post_cats('',$post_ID,$post_category); 
     44 
     45    // Set GUID 
     46    $wpdb->query("UPDATE $wpdb->posts SET guid = '" . get_permalink($post_ID) . "' WHERE ID = '$post_ID'"); 
     47     
     48    wp_set_post_cats('', $post_ID, $post_category); 
    4649     
    4750    if ($post_status == 'publish') { 
    4851        do_action('publish_post', $post_ID); 
    4952    } 
     53 
     54    pingback($content, $post_ID); 
    5055 
    5156    // Return insert_id if we got a good result, otherwise return zero. 
  • trunk/wp-mail.php

    r1599 r1604  
    115115    $content = trim($content); 
    116116 
    117     $content = apply_filters('phone_content', $content); 
     117    $post_content = apply_filters('phone_content', $content); 
    118118 
    119119    $post_title = xmlrpc_getposttitle($content); 
     
    123123    if (empty($post_categories)) $post_categories[] = get_settings('default_email_category'); 
    124124 
    125     $post_title = addslashes(trim($post_title)); 
    126     // Make sure that we get a nice post-slug 
    127     $post_name = sanitize_title( $post_title ); 
    128     $content = preg_replace("|\n([^\n])|", " $1", $content); 
    129     $content = addslashes(trim($content)); 
     125    $post_category = $post_categories; 
    130126 
    131     $sql = "INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_title, post_name, post_modified, post_modified_gmt) VALUES (1, '$post_date', '$post_date_gmt', '$content', '$post_title', '$post_name', '$post_date', '$post_date_gmt')"
     127    $post_data = compact('post_content','post_title','post_date','post_date_gmt','post_author','post_category')
    132128 
    133     $result = $wpdb->query($sql); 
    134     $post_ID = $wpdb->insert_id; 
     129    wp_insert_post($post_data); 
    135130 
    136     do_action('publish_post', $post_ID); 
    137131    do_action('publish_phone', $post_ID); 
    138     pingback($content, $post_ID); 
    139132 
    140133    echo "\n<p><b>Posted title:</b> $post_title<br />";