mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Don't lose tags when saving a post with attachments. Props filosofo. fixes #4532
git-svn-id: https://develop.svn.wordpress.org/trunk@6121 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -581,12 +581,14 @@ function wp_get_single_post($postid = 0, $mode = OBJECT) {
|
||||
|
||||
$post = get_post($postid, $mode);
|
||||
|
||||
// Set categories
|
||||
// Set categories and tags
|
||||
if($mode == OBJECT) {
|
||||
$post->post_category = wp_get_post_categories($postid);
|
||||
$post->tags_input = wp_get_post_tags($postid, array('fields' => 'names'));
|
||||
}
|
||||
else {
|
||||
$post['post_category'] = wp_get_post_categories($postid);
|
||||
$post['tags_input'] = wp_get_post_tags($postid, array('fields' => 'names'));
|
||||
}
|
||||
|
||||
return $post;
|
||||
|
||||
Reference in New Issue
Block a user