【发布时间】:2020-05-28 19:16:03
【问题描述】:
我需要解决此错误的解决方案。 CMS Wordpress(4.4.21),插件 Woocommerce(2.1.6)。 PHP(7.3.6)
sizeof():参数必须是数组或者实现了Countable的对象 /var/www/u0900579/data/www/xxx/wp-content/plugins/woocommerce/includes/wc-conditional-functions.php 在第 237 行
function is_filtered() {
global $_chosen_attributes;
ERROR! ------> return apply_filters( 'woocommerce_is_filtered', ( sizeof( $_chosen_attributes ) > 0 || ( isset( $_GET['max_price'] ) && isset( $_GET['min_price'] ) ) ) );
}
}
【问题讨论】:
-
错误信息里给你解决方法。传递给
count()的参数,在本例中为变量$_chosen_attributes,必须是实现Countable的数组或对象。
标签: php wordpress woocommerce