mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
git-svn-id: http://svn.automattic.com/wordpress/trunk@2064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
46fa15f8d1
commit
f20de56a5b
@ -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…
Reference in New Issue
Block a user