git-svn-id: http://svn.automattic.com/wordpress/trunk@2064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2005-01-07 01:21:12 +00:00
parent 46fa15f8d1
commit f20de56a5b
1 changed files with 8 additions and 7 deletions

View File

@ -87,18 +87,17 @@ function wp_update_post($postarr = array()) {
global $wpdb; global $wpdb;
// First get all of the original fields // First get all of the original fields
extract(wp_get_single_post($postarr['ID'],ARRAY_A)); extract(wp_get_single_post($postarr['ID'], ARRAY_A));
// Now overwrite any changed values being passed in // Now overwrite any changed values being passed in
extract($postarr); extract($postarr);
// Make sure we set a valid category // Make sure we set a valid category
if (0 == count($post_category) || !is_array($post_category)) { if ( 0 == count($post_category) || !is_array($post_category) )
$post_category = array($post_default_category); $post_category = array($post_default_category);
}
// Do some escapes for safety // Do some escapes for safety
$post_title = $wpdb->escape($post_title); $post_title = $wpdb->escape($post_title);
$post_excerpt = $wpdb->escape($post_excerpt); $post_excerpt = $wpdb->escape($post_excerpt);
$post_content = $wpdb->escape($post_content); $post_content = $wpdb->escape($post_content);
@ -121,8 +120,10 @@ function wp_update_post($postarr = array()) {
$result = $wpdb->query($sql); $result = $wpdb->query($sql);
wp_set_post_cats('',$ID,$post_category); wp_set_post_cats('', $ID, $post_category);
do_action('edit_post', $ID);
return $wpdb->rows_affected; return $wpdb->rows_affected;
} }