mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
Check for WP_Error return values when using get_term_field() to set up nav menu items. fixes #17958 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@18426 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -605,6 +605,8 @@ function wp_setup_nav_menu_item( $menu_item ) {
|
||||
$menu_item->url = !is_wp_error( $term_url ) ? $term_url : '';
|
||||
|
||||
$original_title = get_term_field( 'name', $menu_item->object_id, $menu_item->object, 'raw' );
|
||||
if ( is_wp_error( $original_title ) )
|
||||
$original_title = false;
|
||||
$menu_item->title = '' == $menu_item->post_title ? $original_title : $menu_item->post_title;
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user