A fatal error was encountered when trying to customize the theme and background of WordPress

WordPress comment seven hundred and three Reading mode

If you are prompted that a fatal error has been encountered when you open the WordPress customization and background menu, it is similar to:

 Fatal error: Uncaught Exception: Supplied nav_menu_item value missing property: description in xxxxxxxxxx/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php:183

You can try to solve it with the following code.

 A fatal error was encountered when trying to customize the theme and background of WordPress

Add code to the current topic function template functions.php:

 add_filter('wp_get_nav_menu_items', 'my_wp_get_nav_menu_items', 10, 3); function my_wp_get_nav_menu_items($items, $menu, $args) { foreach($items as $key => $item) $items[$key]->description = ''; return $items; }

After that, the error of opening the custom theme menu again disappears, but the code must remain in the theme. The problem still exists after removal.

Another solution is to delete all the menus previously created in the background to completely solve this problem, and then recreate the menu. I have never tried this method. If you have children's shoes with similar problems, you can try it without any loss.

 

Most of the articles on this site are original and used for personal learning records, which may be helpful to you, for reference only!

 weinxin
My Wechat
Copyright Notice
Please indicate the source and link of the original article reprinted on this site. Thank you for your cooperation!
five hundred and ninety-eight million eight hundred and forty-five thousand and six
 
 Robin
five hundred and ninety-eight million eight hundred and forty-five thousand and six
 anonymous

Comment

Anonymous netizens
 :?:  :razz:  :sad:  :evil:  :!:  :smile:  :oops:  :grin:  :eek:  :shock:  :???:  :cool:  :lol:  :mad:  :twisted:  :roll:  :wink:  :idea:  :arrow:  :neutral:  :cry:  :mrgreen:

Drag the slider to complete validation