浏览代码

Public Themes B: PHP Rector fixes (#7383)

Matthew Reishus 1 年之前
父节点
当前提交
34f3717ef8
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      button-2/inc/template-tags.php

+ 1 - 1
button-2/inc/template-tags.php

@@ -100,7 +100,7 @@ function button_2_categorized_blog() {
 		) );
 
 		// Count the number of categories that are attached to the posts.
-		$all_the_cool_cats = count( $all_the_cool_cats );
+		$all_the_cool_cats = is_countable( $all_the_cool_cats ) ? count( $all_the_cool_cats ) : 0;
 
 		set_transient( 'button_2_categories', $all_the_cool_cats );
 	}