瀏覽代碼

Public Themes A: PHP Rector fixes (#7382)

Matthew Reishus 1 年之前
父節點
當前提交
22553367b4
共有 4 個文件被更改,包括 9 次插入4 次删除
  1. 1 1
      affinity/inc/template-tags.php
  2. 6 2
      altofocus/inc/extras.php
  3. 1 1
      altofocus/inc/template-tags.php
  4. 1 0
      apostrophe-2/inc/template-tags.php

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

@@ -84,7 +84,7 @@ function affinity_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( 'affinity_categories', $all_the_cool_cats );
 	}

+ 6 - 2
altofocus/inc/extras.php

@@ -138,6 +138,9 @@ add_action( 'wp_head', 'altofocus_pingback_header' );
  */
 function altofocus_slideshow_gallery_filter( $output, $attr ) {
 
+	$id = null;
+	$order = null;
+	$size = null;
 	global $post;
 	
 	static $count = 0;
@@ -157,7 +160,7 @@ function altofocus_slideshow_gallery_filter( $output, $attr ) {
 		}
 	}
 
-	extract(shortcode_atts(array(
+	$short_atts = shortcode_atts(array(
 		'order'      => 'ASC',
 		'orderby'    => 'menu_order ID',
 		'id'         => $post->ID,
@@ -168,7 +171,8 @@ function altofocus_slideshow_gallery_filter( $output, $attr ) {
 		'size'       => 'large',
 		'include'    => '',
 		'exclude'    => ''
-	), $attr));
+	), $attr);
+	extract( $short_atts );
 
 	$id = intval($id);
 

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

@@ -123,7 +123,7 @@ function altofocus_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( 'altofocus_categories', $all_the_cool_cats );
 	}

+ 1 - 0
apostrophe-2/inc/template-tags.php

@@ -48,6 +48,7 @@ if ( ! function_exists( 'apostrophe_2_entry_footer' ) ) :
  */
 	function apostrophe_2_entry_footer() {
 
+		$apostrophe_2_tags = null;
 		// Show categories, tags, and author if we're on a post page
 		if ( 'post' === get_post_type() ) {
 			$categories_list = get_the_category_list();