瀏覽代碼

AltoFocus: Adds a check to make sure $featured_ids variable is an array, Fixes an php 7.2 issue that I got pinged about from systems

Allan Cole 7 年之前
父節點
當前提交
454321e221
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      altofocus/inc/jetpack.php

+ 6 - 1
altofocus/inc/jetpack.php

@@ -142,7 +142,12 @@ function altofocus_get_featured_post_ids() {
 	}
 
 	// Ensure correct format before return.
-	return array_map( 'absint', $featured_ids );
+	if ( ! is_array( $featured_ids ) ) {
+		return;
+	} else {
+		return array_map( 'absint', $featured_ids );
+	}
+
 }
 
 /**