问题
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