WordPress.org

Make WordPress Core

Changeset 36095


Ignore:
Timestamp:
12/26/2015 04:04:55 AM (3 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.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-walker-nav-menu-edit.php

    r36016 r36095  
    8181        } elseif ( 'post_type_archive' == $item->type ) {
    8282            $original_object = get_post_type_object( $item->object );
    83             $original_title = $original_object->labels->archives;
     83            if ( $original_object ) {
     84                $original_title = $original_object->labels->archives;
     85            }
    8486        }
    8587
  • 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.