mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
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:
parent
282f3be632
commit
c53efdc053
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user