這個問題通常出在自定義菜單函數處,並且高版本中wordpresss
重新定義了start_el()函數參數,所以報錯。
重寫即可
原:
function start_el(&$output, $item, $depth, $args)
改爲:
function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
原:
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args);
改爲:
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args, $id );