最近我注意到,当尝试加载外观>自定义时,我得到了以下错误:
Notice: Trying to get property of non-object in /home/kavwxoln/feelfreehypnosis.com/wp-includes/class-wp-customize-nav-menus.php on line 682
Fatal error: Uncaught exception 'Exception' with message 'Illegal widget
setting ID: nav_menu_item[]' in /home/kavwxoln/feelfreehypnosis.com/wp-
includes/customize/class-wp-customize-nav-menu-item-setting.php:171 Stack trace: #0 /home/kavwxoln/feelfreehypnosis.com/wp-includes/class-wp-customize-nav-menus.php(693): WP_Customize_Nav_Menu_Item_Setting->__construct(Object(WP_Customize_Manager), 'nav_menu_item[]', Array) #1 [internal function]: WP_Customize_Nav_Menus->customize_register(Object(WP_Customize_Manager)) #2 /home/kavwxoln/feelfreehypnosis.com/wp-includes/class-wp-hook.php(286): call_user_func_array(Array, Array) #3 /home/kavwxoln/feelfreehypnosis.com/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array) #4 /home/kavwxoln/feelfreehypnosis.com/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #5 /home/kavwxoln/feelfreehypnosis.com/wp-includes/class-wp-customize-manager.php(926): do_action('customize_regis...', Object(WP_Customize_Manager)) #6 [internal function]: WP_Customize_Manager->wp_loaded('' in /home/kavwxoln/feelfreehypnosis.com/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php on line 171我在Google上搜索并找到了这个thread,但是当应用到这里提供的答案时:
ALTER TABLE `wp_terms`
CHANGE COLUMN `term_id` `term_id` BIGINT(20) UNSIGNED NOT NULL
AUTO_INCREMENT FIRST,
ADD PRIMARY KEY (`term_id`),
ADD INDEX `name` (`name`),
ADD INDEX `slug` (`slug`);我从phpmyadmin那里得到了这个答案:
#1068 - Multiple primary key defined所以我很想知道如何解决这个问题。
发布于 2018-03-26 15:34:59
我就是这样做的:
wp_terms ( term_id bigint(20)无符号非空AUTO_INCREMENT,name varchar(200) NULL '',slug varchar(200) NULL‘,term_group bigint(10) NULL '0',主键(term_id),唯一密钥slug (slug),KEY name (name) ) ENGINE=MyISAM AUTO_INCREMENT=603默认值CHARSET=utf8;问题解决了!
注意:只从备份中获取行,而不是整个数据库!
https://stackoverflow.com/questions/49414733
复制相似问题