Make WordPress Core


Ignore:
Timestamp:
07/11/2011 07:03:04 PM (13 years ago)
Author:
nacin
Message:

Check for WP_Error return values when using get_term_field() to set up nav menu items. fixes #17958 for trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/nav-menu.php

    r18277 r18426  
    5555        if ( 'taxonomy' == $item->type ) {
    5656            $original_title = get_term_field( 'name', $item->object_id, $item->object, 'raw' );
     57            if ( is_wp_error( $original_title ) )
     58                $original_title = false;
    5759        } elseif ( 'post_type' == $item->type ) {
    5860            $original_object = get_post( $item->object_id );
     
    172174
    173175                <div class="menu-item-actions description-wide submitbox">
    174                     <?php if( 'custom' != $item->type ) : ?>
     176                    <?php if( 'custom' != $item->type && $original_title !== false ) : ?>
    175177                        <p class="link-to-original">
    176178                            <?php printf( __('Original: %s'), '<a href="' . esc_attr( $item->url ) . '">' . esc_html( $original_title ) . '</a>' ); ?>
Note: See TracChangeset for help on using the changeset viewer.