Prechádzať zdrojové kódy

Public Themes S2: PHP Rector fixes (#7395)

Matthew Reishus 1 rok pred
rodič
commit
ce0c116051
2 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 1 1
      sketch/inc/template-tags.php
  2. 1 1
      spearhead/functions.php

+ 1 - 1
sketch/inc/template-tags.php

@@ -114,7 +114,7 @@ function sketch_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( 'sketch_categories', $all_the_cool_cats );
 	}

+ 1 - 1
spearhead/functions.php

@@ -205,7 +205,7 @@ add_filter(
 	function( $classes ) {
 		$stickies = get_option( 'sticky_posts' );
 
-		if ( count( $stickies ) && is_home() ) {
+		if ( is_countable( $stickies ) && count( $stickies ) && is_home() ) {
 			return array_merge( $classes, array( 'has-sticky-post' ) );
 		}