[wp-trac] [WordPress Trac] #37298: unregistered CPT archive link in menu breaks nav/menu admin screen

WordPress Trac noreply at wordpress.org
Wed Jul 6 22:50:23 UTC 2016


#37298: unregistered CPT archive link in menu breaks nav/menu admin screen
-----------------------------+-----------------------------
 Reporter:  littler.chicken  |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Menus            |    Version:  trunk
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 If you have a registered CPT and add the Post Type Archive link to a
 navigation menu, and then remove the CPT from your site (deactivate the
 plugin which registers it, for instance), then the admin screen for
 editing menus throws this error:

 {{{
 PHP Fatal error:  Cannot use object of type WP_Post_Type as array in
 .../wp-admin/includes/screen.php on line 123
 }}}

 It's not a total white screen, but adds the above to the error log. In
 4.5.3, the page loads properly and does warn of an invalid menu item.

 To reproduce, activate a plugin which registers a custom post type. Create
 an entry so that the "All CPT" (Post Type Archive) link is available for
 the menu. Add the Post Type Archive link to the menu and save the menu.
 Deactivate the plugin and then go back to Appearance > Menus.

 Not sure how to fix, but wanted to report. Thanks!

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37298>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list