Opened 14 years ago
Closed 14 years ago
#17175 closed defect (bug) (duplicate)
Custom Menus: handling items who's CPT doesn't exist anymore
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | |
Component: | Menus | Keywords: | |
Focuses: | Cc: |
Description
Steps to reproduce:
- Register a custom post type
- Create a post with that type
- Add that post to a custom menu
- Unregister the custom post type
You will get a notice:
Notice: Trying to get property of non-object in /home/cristi/svn/wp/wp-includes/nav-menu.php on line 565
which is here:
$object = get_post_type_object( $menu_item->object ); $menu_item->type_label = $object->labels->singular_name;
The $object variable will be null in this case.
Change History (2)
Note: See
TracTickets for help on using
tickets.
There must be a duplicate ticket of this.. I cant find it as usual, but I've seen it reported many times..