Set GUID when posting.
git-svn-id: https://develop.svn.wordpress.org/trunk@1604 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
94c29fd51e
commit
bf70fc82bd
@ -167,6 +167,8 @@ case 'post':
|
||||
}
|
||||
|
||||
add_meta($post_ID);
|
||||
|
||||
$wpdb->query("UPDATE $wpdb->posts SET guid = '" . get_permalink($post_ID) . "' WHERE ID = '$post_ID'");
|
||||
|
||||
if (isset($sleep_after_edit) && $sleep_after_edit > 0) {
|
||||
sleep($sleep_after_edit);
|
||||
|
@ -41,13 +41,18 @@ function wp_insert_post($postarr = array()) {
|
||||
|
||||
$result = $wpdb->query($sql);
|
||||
$post_ID = $wpdb->insert_id;
|
||||
|
||||
// Set GUID
|
||||
$wpdb->query("UPDATE $wpdb->posts SET guid = '" . get_permalink($post_ID) . "' WHERE ID = '$post_ID'");
|
||||
|
||||
wp_set_post_cats('',$post_ID,$post_category);
|
||||
wp_set_post_cats('', $post_ID, $post_category);
|
||||
|
||||
if ($post_status == 'publish') {
|
||||
do_action('publish_post', $post_ID);
|
||||
}
|
||||
|
||||
pingback($content, $post_ID);
|
||||
|
||||
// Return insert_id if we got a good result, otherwise return zero.
|
||||
return $result ? $post_ID : 0;
|
||||
}
|
||||
|
15
wp-mail.php
15
wp-mail.php
@ -114,7 +114,7 @@ for ($i=1; $i <= $count; $i++) :
|
||||
|
||||
$content = trim($content);
|
||||
|
||||
$content = apply_filters('phone_content', $content);
|
||||
$post_content = apply_filters('phone_content', $content);
|
||||
|
||||
$post_title = xmlrpc_getposttitle($content);
|
||||
|
||||
@ -122,20 +122,13 @@ for ($i=1; $i <= $count; $i++) :
|
||||
|
||||
if (empty($post_categories)) $post_categories[] = get_settings('default_email_category');
|
||||
|
||||
$post_title = addslashes(trim($post_title));
|
||||
// Make sure that we get a nice post-slug
|
||||
$post_name = sanitize_title( $post_title );
|
||||
$content = preg_replace("|\n([^\n])|", " $1", $content);
|
||||
$content = addslashes(trim($content));
|
||||
$post_category = $post_categories;
|
||||
|
||||
$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')";
|
||||
$post_data = compact('post_content','post_title','post_date','post_date_gmt','post_author','post_category');
|
||||
|
||||
$result = $wpdb->query($sql);
|
||||
$post_ID = $wpdb->insert_id;
|
||||
wp_insert_post($post_data);
|
||||
|
||||
do_action('publish_post', $post_ID);
|
||||
do_action('publish_phone', $post_ID);
|
||||
pingback($content, $post_ID);
|
||||
|
||||
echo "\n<p><b>Posted title:</b> $post_title<br />";
|
||||
echo "\n<b>Posted content:</b><br /><pre>".$content.'</pre></p>';
|
||||
|
Loading…
Reference in New Issue
Block a user