Opened 8 months ago
Closed 8 months ago
#22167 closed defect (bug) (fixed)
Categories revert to default when scheduled posts are published
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | General | Version: | 3.5 |
| Severity: | major | Keywords: | |
| Cc: |
Description
The issue is that a scheduled post's categories are dropped when it's published. check_and_publish_future_post() calls wp_publish_post():
http://core.trac.wordpress.org/browser/trunk/wp-includes/post.php#L2882
which, in turn, gets a WP_Post object, changes the status, can calls wp_insert_post():
http://core.trac.wordpress.org/browser/trunk/wp-includes/post.php#L2863
but, because post_category isn't a part of the WP_Post object, the categories default to default
r21942 seems to be the culprit. This is reproducible on wpcom and in trunk.
Replaces wp_insert_post() with wp_update_post() and fixes the issue