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

git-svn-id: http://svn.automattic.com/wordpress/trunk@14048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-04-10 10:47:31 +00:00
parent b4d8b0cbb7
commit 7b1211b536
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 // @todo transient caching of these results with proper invalidation on updating of a tax of this type
$terms = get_terms( $taxonomy['args']->name, $args ); $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>'; $error = '<li id="error">'. sprintf( __( 'No %s exists' ), $taxonomy['args']->label ) .'</li>';
$term_names = ''; $term_names = '';