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:
parent
2254f7d6e9
commit
b8efedcb23
@ -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 = '';
|
||||
|
Loading…
Reference in New Issue
Block a user