[wp-trac] Re: [WordPress Trac] #5057: cannot remove all categories
from a post
WordPress Trac
wp-trac at lists.automattic.com
Fri Mar 14 00:24:56 GMT 2008
#5057: cannot remove all categories from a post
-------------------------------+--------------------------------------------
Reporter: Denis-de-Bernardy | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.5
Component: Administration | Version: 2.3
Severity: normal | Resolution:
Keywords: |
-------------------------------+--------------------------------------------
Comment (by Denis-de-Bernardy):
dropping this in wp_update_post() works:
{{{
// Passed post category list overwrites existing category list if
not empty.
if ( isset($postarr['post_category']) &&
is_array($postarr['post_category'])
&& 0 != count($postarr['post_category']) )
$post_cats = $postarr['post_category'];
else
$post_cats = $post['post_category'];
}}}
if the list is empty, it gets caught afterwards and the default category
gets assigned
--
Ticket URL: <http://trac.wordpress.org/ticket/5057#comment:9>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list