Sfoglia il codice sorgente

Public Themes D: PHP Rector fixes (#7385)

Matthew Reishus 1 anno fa
parent
commit
464be6edb9
3 ha cambiato i file con 4 aggiunte e 3 eliminazioni
  1. 2 1
      dara/functions.php
  2. 1 1
      dara/inc/template-tags.php
  3. 1 1
      dyad-2/inc/template-tags.php

+ 2 - 1
dara/functions.php

@@ -199,6 +199,7 @@ function dara_the_custom_logo() {
  * Returns the Google font stylesheet URL, if available.
  */
 function dara_fonts_url() {
+	$merriweather = null; // This is most likely missing functionality; adding null init to pass rector.
 	$fonts_url = '';
 
 	/* translators: If there are characters in your language that are not supported
@@ -211,7 +212,7 @@ function dara_fonts_url() {
 	 */
 	$yrsa = esc_html_x( 'on', 'Yrsa font: on or off', 'dara' );
 
-	if ( 'off' !== $source_sans_pro || 'off' !== $merriweather || 'off' !== $Yrsa ) {
+	if ( 'off' !== $source_sans_pro || 'off' !== $merriweather || 'off' !== $yrsa ) {
 		$font_families = array();
 
 		if ( 'off' !== $source_sans_pro ) {

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

@@ -81,7 +81,7 @@ function dara_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( 'dara_categories', $all_the_cool_cats );
 	}

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

@@ -95,7 +95,7 @@ function dyad_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( 'dyad_2_categories', $all_the_cool_cats );
 	}