mirror of
git://develop.git.wordpress.org/
synced 2025-01-19 13:47:02 +01:00
git-svn-id: https://develop.svn.wordpress.org/trunk@2064 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a576d90d73
commit
1eb6a8e91d
@ -87,18 +87,17 @@ function wp_update_post($postarr = array()) {
|
||||
global $wpdb;
|
||||
|
||||
// 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
|
||||
extract($postarr);
|
||||
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
// Do some escapes for safety
|
||||
$post_title = $wpdb->escape($post_title);
|
||||
$post_title = $wpdb->escape($post_title);
|
||||
$post_excerpt = $wpdb->escape($post_excerpt);
|
||||
$post_content = $wpdb->escape($post_content);
|
||||
|
||||
@ -121,8 +120,10 @@ function wp_update_post($postarr = array()) {
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user