网站升级php版本到7.1+出现的错误。网站头部出现以下代码。
Warning: Declaration of Walker_Child_Classes::start_el(&$output, $page, $depth, $args, $current_page) should be compatible with Walker_Page::start_el(&$output, $page, $depth = 0, $args = Array, $current_page = 0) in /www/wwwroot/www.***cn/wp-content/themes/***/options/extra.php on line*** Warning: Declaration of Walker_Page_Custom::start_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = Array) in /www/wwwroot/www.***.cn/wp-content/themes/***/options/extra.php on line ***
解决办法很简单,在出问题的提示文件里面 themes/***/options/extra.php,修改提示的两个错误。
更改成如下
function start_el(&$output, $page, $depth = 0, $args = array(), $current_page = 0) {
和
function start_lvl(&$output,$depth = 0, $args = array()) {
然后问题解决。
7.3问题
Warning: count(): Parameter must be an array or an object that implements Countable in /www/wwwroot/www.b***e.com/wp-content/themes/s**/cmb/init.php on line 746
elseif ( is_array( $meta_box['pages'] ) && count( $meta_box['pages'] === 1) 改成 elseif ( is_array( $meta_box['pages'] ) && count( $meta_box['pages'] ) === 1 )