乐云主机笔记

  • 首页
  • 主机优惠
  • 学习记录
  • 新手教程
  • 自用主机
  • 资源下载
  • 网赚项目
  • 其他
  • pingtest

  1. 首页
  2. 学习记录
  3. 正文

解决 PHP 7.2 环境中 WordPress管理后台报Warning: count(): Parameter must be an array or an object that implements Co..

2020年3月6日 884点热度 0人点赞 0条评论

再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();

保存后,刷新报错页面,成功消除保障

标签: 暂无
最后更新:2020年3月6日

letvps

这个人很懒,什么都没留下

打赏 点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

分类
  • 主机优惠
  • 其他
  • 域名优惠
  • 学习记录
  • 新手教程
  • 网赚项目
  • 脚本源码
  • 自用主机
  • 资源下载
书签
  • AdvinServers.com
  • 猫云云计算

COPYRIGHT © 2021 Letcloud.cn. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

粤ICP备15031609号-3