[wp-trac] [WordPress Trac] #10122: create metaboxes for hierarchical taxonomies
WordPress Trac
wp-trac at lists.automattic.com
Sat Apr 24 04:19:44 UTC 2010
#10122: create metaboxes for hierarchical taxonomies
-----------------------------+----------------------------------------------
Reporter: nicomollet | Owner: ryan
Type: feature request | Status: reopened
Priority: normal | Milestone: 3.0
Component: Taxonomy | Version: 2.8
Severity: minor | Resolution:
Keywords: needs-patch |
-----------------------------+----------------------------------------------
Comment(by dd32):
updated code:
{{{
// new-style support for all taxonomies
$tax_names = get_object_taxonomies( get_post($post_ID) );
foreach ( (array)$tax_names as $taxonomy ) {
if ( 'category' == $taxonomy ) // Handled seperately.
continue;
$taxonomy_obj = get_taxonomy($taxonomy);
if ( !current_user_can($taxonomy_obj->assign_cap) )
continue;
if ( !current_user_can($taxonomy_obj->show_ui) )
continue;
$tags = isset($tax_input[$taxonomy]) ?
$tax_input[$taxonomy] : array();
wp_set_post_terms( $post_ID, $tags, $taxonomy );
}
}}}
Previous code was causing all Categories to be striped from posts.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/10122#comment:41>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list