Make WordPress Core

Changeset 1604 for trunk/wp-mail.php


Ignore:
Timestamp:
09/05/2004 02:03:51 AM (22 years ago)
Author:
saxmatt
Message:

Set GUID when posting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 />";
Note: See TracChangeset for help on using the changeset viewer.