Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
414 views
in Technique[技术] by (71.8m points)

PHP7.4 Problem - count(): Parameter must be an array or an object that implements (NULL)

pls help me to correct this (on my wordpress theme):

Warning: count(): Parameter must be an array or an object that implements Countable in generic.php on line 1104

1104:

1104    if(count($merged==0))
1105                $merged[]=0;
1106
1107    $params = array(
1108    'post__in' => $merged,
1109    'post_type' => $all_post_types,
1110    'posts_per_page' => -1,
1111     'suppress_filter' => false,
1112    'orderby' => 'post__in'
1113    );

I'm no coder so a copy and paste solution would be highly appriciated, thank you so much in advance

I tried and changed: 1104:

 if(count($merged==0))
                   $merged[]=0;
to just

if(count($merged)==0)
or
if($merged)==0)
or
if(!is_array($merged)==0))

that did nothing or screwed the side completely. I guess the Problem is after 7.2 the parameter NULL is no longer valid. so I checked the forum but nothing matches this specific "merged"

question from:https://stackoverflow.com/questions/65886758/php7-4-problem-count-parameter-must-be-an-array-or-an-object-that-implement

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...