This question already has answers here: Error: Declaration of MyClass::start_lvl() should be compatible with that of Walker_Nav_Menu::start_lvl() (3 answers) Closed 8 years ago.admin管理员组文章数量:1410674
I upgraded my PHP to 7.0 and after this I have this message in the header of my website:
Warning: Declaration of description_walker::start_el($output, $item, $depth, $args) should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = Array, $id = 0) in /homepages/2/d444683358/htdocs/wp-content/themes/zend/functions.php on line 59
Here is the line 59
in functions.php:
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
I'm not a coder so not sure what needs to be done to fix this?
Thanks for your help
This question already has answers here: Error: Declaration of MyClass::start_lvl() should be compatible with that of Walker_Nav_Menu::start_lvl() (3 answers) Closed 8 years ago.I upgraded my PHP to 7.0 and after this I have this message in the header of my website:
Warning: Declaration of description_walker::start_el($output, $item, $depth, $args) should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = Array, $id = 0) in /homepages/2/d444683358/htdocs/wp-content/themes/zend/functions.php on line 59
Here is the line 59
in functions.php:
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
I'm not a coder so not sure what needs to be done to fix this?
Thanks for your help
Share Improve this question edited Nov 20, 2019 at 20:59 Robert 1034 bronze badges asked Dec 12, 2016 at 15:44 robtus88robtus88 2111 gold badge2 silver badges4 bronze badges 1- 2 It would be probably best to report it to theme's developers/support. – Rarst Commented Dec 12, 2016 at 15:49
1 Answer
Reset to default 32The error message shows that the class description_walker
extends the Walker_Nav_Menu
class and overrides the start_el()
method, but the signature differs from the method definition in the parent class.
As mentioned in comments, it would be best to contact the developer of your theme and ask for a corrected version of the theme.
If the developer cannot be reached or you really want to correct the theme yourself, you can do the following. But keep in mind that any changes to the theme files are overwritten on theme update.
Search the theme files for the function definition of start_el()
inside the description_walker
class. The line of code should look similar to this:
function start_el( $output, $item, $depth, $args ) {
Changing this line to the following should make the warning disappear:
function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
本文标签: functionsError Warning Declaration of descriptionwalkerstartel after PHP upgrade
版权声明:本文标题:functions - Error Warning: Declaration of description_walker::start_el after PHP upgrade 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744986831a2636141.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论