فهرست منبع

Public Themes Q, R: PHP Rector fixes (#7392)

Matthew Reishus 1 سال پیش
والد
کامیت
09e868f737
4فایلهای تغییر یافته به همراه9 افزوده شده و 2 حذف شده
  1. 1 0
      quadrat/functions.php
  2. 1 0
      radcliffe-2/inc/icon-functions.php
  3. 4 0
      radcliffe-2/inc/logo-resizer.php
  4. 3 2
      rebalance/inc/template-tags.php

+ 1 - 0
quadrat/functions.php

@@ -3,6 +3,7 @@
 
 if ( ! function_exists( 'quadrat_support' ) ) :
 	function quadrat_support() {
+		$quadrat_starter_content = null;
 		// Add support for starter content
 		include get_stylesheet_directory() . '/inc/starter-content.php';
 		add_theme_support(

+ 1 - 0
radcliffe-2/inc/icon-functions.php

@@ -32,6 +32,7 @@ add_action( 'wp_footer', 'radcliffe_2_include_svg_icons', 9999 );
  * @return string SVG markup.
  */
 function radcliffe_2_get_svg( $args = array() ) {
+	$unique_id = null;
 	// Make sure $args are an array.
 	if ( empty( $args ) ) {
 		return esc_html__( 'Please define default parameters in the form of an array.', 'radcliffe-2' );

+ 4 - 0
radcliffe-2/inc/logo-resizer.php

@@ -38,6 +38,8 @@ add_action( 'customize_register', 'logo_awesomeness_customize_register' );
  * Add support for logo resizing by filtering `get_custom_logo`
  */
 function logo_awesomeness_customize_logo_resize( $html ) {
+	$max = [];
+	$img = [];
 	$size = get_theme_mod( 'logo_size' );
 	$custom_logo_id = get_theme_mod( 'custom_logo' );
 	// set the short side minimum
@@ -93,6 +95,8 @@ add_filter( 'get_custom_logo', 'logo_awesomeness_customize_logo_resize' );
 
 /* Helper function to determine the max size of the logo */
 function logo_awesomeness_min_max( $short, $long, $short_max, $long_max, $percent, $min ){
+	$max = [];
+	$size = [];
 	$ratio = ( $long / $short );
 	$max['long'] = ( $long_max >= $long ) ? $long : $long_max;
 	$max['short'] = ( $short_max >= ( $max['long'] / $ratio ) ) ? floor( $max['long'] / $ratio ) : $short_max;

+ 3 - 2
rebalance/inc/template-tags.php

@@ -189,6 +189,7 @@ if ( ! function_exists('rebalance_the_attached_image')) :
  * @since Twenty Fourteen 1.0
  */
 function rebalance_the_attached_image() {
+	$next_id = null;
 	$post = get_post();
 	/**
 	 * Filter the default Twenty Fourteen attachment size.
@@ -222,7 +223,7 @@ function rebalance_the_attached_image() {
 		));
 
 		// If there is more than 1 attachment in a gallery...
-		if (count($attachment_ids) > 1) {
+		if (is_countable($attachment_ids) && count($attachment_ids) > 1) {
 			foreach ($attachment_ids as $idx => $attachment_id) {
 				if ($attachment_id == $post->ID) {
 					$next_id = $attachment_ids[ ( $idx + 1 ) % count( $attachment_ids ) ];
@@ -266,7 +267,7 @@ function rebalance_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( 'rebalance_categories', $all_the_cool_cats );
 	}