Check for WP_Error. Props ptahdunbar. fixes #12949

git-svn-id: http://svn.automattic.com/wordpress/trunk@14599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-05-13 16:34:14 +00:00
parent 282f3be632
commit c53efdc053

View File

@ -514,7 +514,8 @@ function wp_setup_nav_menu_item( $menu_item ) {
} elseif ( 'taxonomy' == $menu_item->type ) {
$object = get_taxonomy( $menu_item->object );
$menu_item->type_label = $object->singular_label;
$menu_item->url = get_term_link( (int) $menu_item->object_id, $menu_item->object );
$term_url = get_term_link( (int) $menu_item->object_id, $menu_item->object );
$menu_item->url = !is_wp_error( $term_url ) ? $term_url : '';
$original_title = get_term_field( 'name', $menu_item->object_id, $menu_item->object, 'raw' );
$menu_item->title = '' == $menu_item->post_title ? $original_title : $menu_item->post_title;