Account for WP_Error from get_terms() in the nav menu tax metabox. fixes #12949, props ptahdunbar.

git-svn-id: https://develop.svn.wordpress.org/trunk@14048 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-04-10 10:47:31 +00:00
parent 2254f7d6e9
commit b8efedcb23
1 changed files with 1 additions and 1 deletions

View File

@ -247,7 +247,7 @@ function wp_nav_menu_item_taxonomy_metabox( $object, $taxonomy ) {
// @todo transient caching of these results with proper invalidation on updating of a tax of this type
$terms = get_terms( $taxonomy['args']->name, $args );
if ( !$terms )
if ( !$terms || is_wp_error($terms) )
$error = '<li id="error">'. sprintf( __( 'No %s exists' ), $taxonomy['args']->label ) .'</li>';
$term_names = '';