DW Q & A Error: count(): Parameter must be an array
-
DW Question and Answer is causing this error in my WordPress:
[28-Jan-2018 18:46:56 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /xxx/xxxxxx/xxxxx/wp-content/plugins/dw-question-answer/inc/Status.php on line 247The code that causes this error is in the Status.php file and it is here:
$latest = get_transient( 'dwqa_latest_answer_for_' . $question_id ); if ( false === $latest ) { $args = array( 'post_type' => 'dwqa-answer', 'meta_query' => array( array( 'key' => '_question', 'value' => $question_id, 'compare' => '=', ), ), 'post_status' => 'public,private', 'numberposts' => 1, ); $recent_answers = wp_get_recent_posts( $args, OBJECT ); if ( count( $recent_answers ) > 0 ) { $latest = $recent_answers[0]; // This cache need to be update when new answer is added set_transient( 'dwqa_latest_answer_for_' . $question_id, $latest, 450 ); } }- This topic was modified 8 years, 3 months ago by .
- This topic was modified 8 years, 3 months ago by .
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘DW Q & A Error: count(): Parameter must be an array’ is closed to new replies.