Explorar o código

Public Themes S1: PHP Rector fixes (#7393)

Matthew Reishus hai 1 ano
pai
achega
4cfe615ebd

+ 1 - 0
scratchpad/functions.php

@@ -238,6 +238,7 @@ add_action( 'enqueue_block_editor_assets', 'scratchpad_editor_styles' );
  * Used on image format posts as fallback.
 */
 function scratchpad_get_image( $post_id = null, $thumbnail_size = '' ) {
+	$image = null;
 	if ( ! $post_id ) {
 		$post_id = get_the_ID();
 	}

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

@@ -160,7 +160,7 @@ function scratchpad_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( 'scratchpad_categories', $all_the_cool_cats );
 	}

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

@@ -89,7 +89,7 @@ function shoreditch_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( 'shoreditch_categories', $all_the_cool_cats );
 	}