WordPress/wporg-news-2021

PHP Warning: count(): Parameter must be an array or an object that implements Countable in wp-content/themes/wporg-news-2021/functions.php:169

Opened this issue · 0 comments

dd32 commented
count(): Parameter must be an array or an object that implements Countable
Source: POST https://wordpress.org/news/wp-admin/admin-ajax.php

Referer: https://wordpress.org/news/wp-admin/edit.php?s=people+of+wordpress&post_status=all&post_type=post&action=-1&m=0&cat=0&paged=1&action2=-1

File: wp-content/themes/wporg-news-2021/functions.php
Line: 169

Current user: ....
Filter stack: wp_ajax_inline-save, post_class

Current filter: post_class
- attached to priority 10: WordPressdotorg\Theme\News_2021\specify_post_classes

https://github.com/WordPress/wporg-news-2021/blob/trunk/source/wp-content/themes/wporg-news-2021/functions.php#L161-L174

Possibly the ! is_object( $wp_query ) check could be changed to empty( $wp_query->posts )