Revert [14230]. Broke menu save. see #10122

git-svn-id: https://develop.svn.wordpress.org/trunk@14247 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-04-27 00:44:38 +00:00
parent 6ba4b97fc8
commit cb27ac1a30

View File

@ -2229,20 +2229,14 @@ function wp_insert_post($postarr = array(), $wp_error = false) {
// old-style tags_input // old-style tags_input
if ( isset( $tags_input ) ) if ( isset( $tags_input ) )
wp_set_post_tags( $post_ID, $tags_input ); wp_set_post_tags( $post_ID, $tags_input );
// new-style support for all taxonomies // new-style support for all tag-like taxonomies
$tax_names = get_object_taxonomies( get_post($post_ID) ); if ( !empty($tax_input) ) {
foreach ( (array)$tax_names as $taxonomy ) { foreach ( $tax_input as $taxonomy => $tags ) {
if ( 'category' == $taxonomy ) // Handled seperately.
continue;
$taxonomy_obj = get_taxonomy($taxonomy); $taxonomy_obj = get_taxonomy($taxonomy);
if ( !current_user_can($taxonomy_obj->assign_cap) ) if ( current_user_can($taxonomy_obj->assign_cap) )
continue;
if ( !$taxonomy_obj->show_ui )
continue;
$tags = isset($tax_input[$taxonomy]) ? $tax_input[$taxonomy] : array();
wp_set_post_terms( $post_ID, $tags, $taxonomy ); wp_set_post_terms( $post_ID, $tags, $taxonomy );
} }
}
$current_guid = get_post_field( 'guid', $post_ID ); $current_guid = get_post_field( 'guid', $post_ID );