mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Set GUID when posting.
git-svn-id: https://develop.svn.wordpress.org/trunk@1604 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user