Warning: Use of undefined constant register_nav_menu - assumed 'register_nav_menu' (this will throw an Error in a future version of PHP)

我与影子孤独终老i 提交于 2020-08-20 12:23:27

问题


Previously i am using PHP 5.6, i wasn't see that problem ever. But when i am using php 7.3 i saw this problem arise.

I am using latest wordpress version 5.2.3.

when I run my wordpress site in top of the page it shows the message

Warning: Use of undefined constant `register_nav_menu` - assumed `register_nav_menu` (this will throw an Error in a future version of PHP) in `C:\xampp\htdocs\wordpress\newspaper\wp-content\themes\news\functions.php` on line 14

How can i solve this problem?


回答1:


tipically, this error appear when you make a syntax error.

I assume register_nav_menu is a function. So, I think you forgot the parentheses after register_nav_menu. You should write register_nav_menu().

If it's a variable, you probably forgot $. If it's a string, check your quote.

Without your code, it's really complicated to be more specific.



来源:https://stackoverflow.com/questions/58219662/warning-use-of-undefined-constant-register-nav-menu-assumed-register-nav-men

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!