Nav Menus: Avoid a PHP Notice when a menu contains a now unregistered post type archive.
Props kucrut. Fixes #34449 for trunk. Built from https://develop.svn.wordpress.org/trunk@36095 git-svn-id: http://core.svn.wordpress.org/trunk@36060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d5d401ad10
commit
1d19b930fc
|
@ -80,8 +80,10 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
|
|||
$original_title = get_the_title( $original_object->ID );
|
||||
} elseif ( 'post_type_archive' == $item->type ) {
|
||||
$original_object = get_post_type_object( $item->object );
|
||||
if ( $original_object ) {
|
||||
$original_title = $original_object->labels->archives;
|
||||
}
|
||||
}
|
||||
|
||||
$classes = array(
|
||||
'menu-item menu-item-depth-' . $depth,
|
||||
|
|
|
@ -417,8 +417,10 @@ function wp_update_nav_menu_item( $menu_id = 0, $menu_item_db_id = 0, $menu_item
|
|||
$original_title = $original_object->post_title;
|
||||
} elseif ( 'post_type_archive' == $args['menu-item-type'] ) {
|
||||
$original_object = get_post_type_object( $args['menu-item-object'] );
|
||||
if ( $original_object ) {
|
||||
$original_title = $original_object->labels->archives;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $args['menu-item-title'] == $original_title )
|
||||
$args['menu-item-title'] = '';
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.5-alpha-36094';
|
||||
$wp_version = '4.5-alpha-36095';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue