Browse Source

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 years ago
parent
commit
454321e221
1 changed files with 6 additions and 1 deletions
  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 );
+	}
+
 }
 
 /**