Check for WP_Error. Props ptahdunbar. fixes #12949
git-svn-id: https://develop.svn.wordpress.org/trunk@14599 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
580e82b661
commit
0a38355cce
|
@ -514,7 +514,8 @@ function wp_setup_nav_menu_item( $menu_item ) {
|
||||||
} elseif ( 'taxonomy' == $menu_item->type ) {
|
} elseif ( 'taxonomy' == $menu_item->type ) {
|
||||||
$object = get_taxonomy( $menu_item->object );
|
$object = get_taxonomy( $menu_item->object );
|
||||||
$menu_item->type_label = $object->singular_label;
|
$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' );
|
$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;
|
$menu_item->title = '' == $menu_item->post_title ? $original_title : $menu_item->post_title;
|
||||||
|
|
Loading…
Reference in New Issue