当我试图编辑自定义帖子类型的帖子时,我遇到了这个错误。
当我按下“复制错误”时,我得到以下信息:
TypeError: Cannot read property \'prefix\' of null
at https://example.com/wp-includes/js/dist/edit-post.min.js?ver=3.1.6:12:56693
at ph (https://example.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:97:88)
at eg (https://example.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:125:307)
at fg (https://example.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:126:168)
at wc (https://example.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:138:237)
at fa (https://example.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:137:115)
at gg (https://example.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:135:196)
at Ca (https://example.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:133:365)
at Object.enqueueSetState (https://example.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:191:324)
at r.q.setState (https://example.com/wp-includes/js/dist/vendor/react.min.js?ver=16.6.3:20:304)
最合适的回答,由SO网友:marvinpoo 整理而成
所以,我对这个话题进行了更深入的研究。此SE上的所有答案都建议使用插件禁用古腾堡。这对我来说不是一个有效的“修复”。
在研究和浏览了WordPress/gutenberg
我找到了一个解决这个问题的非常简单的方法。
用户joshuafredrickson
在git上,建议将自定义post类型数组的参数从\'public\' => false,
到true.
我已经在我的多个客户项目上检查了该修复,每次都有效。
Credits: