Make WordPress Core


Ignore:
Timestamp:
12/26/2015 04:04:55 AM (9 years ago)
Author:
dd32
Message:

Nav Menus: Avoid a PHP Notice when a menu contains a now unregistered post type archive.

Props kucrut.
Fixes #34449 for trunk.

File:
1 edited

Legend:

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

    r35979 r36095  
    418418        } elseif ( 'post_type_archive' == $args['menu-item-type'] ) {
    419419            $original_object = get_post_type_object( $args['menu-item-object'] );
    420             $original_title = $original_object->labels->archives;
     420            if ( $original_object ) {
     421                $original_title = $original_object->labels->archives;
     422            }
    421423        }
    422424
Note: See TracChangeset for help on using the changeset viewer.