再PHP7.2环境下安装了老版的wp,登录后台再安装插件界面显示了错误保障:
Warning: count(): Parameter must be an array or an object that implements Co...
查看报故障的程序段,如下:
// Check global in case errors have been added on this pageload. if ( ! count( $wp_settings_errors ) ) return array();
搜索网上得到的解决方式是在
! count( $wp_settings_errors )
之前添加判断是否数组,修改后如下:
// Check global in case errors have been added on this pageload. if ( ! is_array( $wp_settings_errors ) || ! count( $wp_settings_errors ) ) return array();
保存后,刷新报错页面,成功消除保障
文章评论