Explorar o código

Public Themes C: PHP Rector fixes (#7384)

Matthew Reishus hai 1 ano
pai
achega
2175a22e91
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      canard/inc/template-tags.php

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

@@ -155,6 +155,7 @@ if ( ! function_exists( 'the_archive_title' ) ) :
  * @param string $after  Optional. Content to append to the title. Default empty.
  */
 function the_archive_title( $before = '', $after = '' ) {
+	$title = '';
 	if ( is_category() ) {
 		$title = sprintf( __( 'Category: %s', 'canard' ), single_cat_title( '', false ) );
 	} elseif ( is_tag() ) {
@@ -254,7 +255,7 @@ function canard_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( 'canard_categories', $all_the_cool_cats );
 	}