gpt4 book ai didi

PHP 错误 : Warning: count(): Parameter must be an array or an object that implements Countable

转载 作者:行者123 更新时间:2023-12-04 01:15:00 25 4
gpt4 key购买 nike

我将我的 Wordpress 网站从 PHP 5.6 更新到 7.2,并注意到更新后我的 Wordpress 后端出现错误。它说:

Warning:  count(): Parameter must be an array or an object that implements 
Countable in <b>/homepages/36/d362586048/htdocs/genag/wp-
content/themes/genag-
theme/framework/admin/functions/functions.mediauploader.php on line 127

我已经包含了该行及其下方两行的代码。任何帮助将不胜感激。

if ( count( $_posts ) ) {
$_id = $_posts->ID;
} else {

最佳答案

$_posts 看起来是一个对象,你应该像对象 $_posts->ID 一样使用它。所以不能像数组一样算。

if ( $_posts ) {

应该做的工作

关于PHP 错误 : Warning: count(): Parameter must be an array or an object that implements Countable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54381453/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com