From 991036487a35a1d9337cf3a81e718a8e5a5e6b50 Mon Sep 17 00:00:00 2001 From: amartya-dev Date: Thu, 29 Feb 2024 15:58:07 +0530 Subject: [PATCH] fix empty generated images --- includes/SiteGen/SiteGen.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/SiteGen/SiteGen.php b/includes/SiteGen/SiteGen.php index 9780d9a..7f95b4e 100644 --- a/includes/SiteGen/SiteGen.php +++ b/includes/SiteGen/SiteGen.php @@ -440,8 +440,9 @@ public static function get_home_pages( $site_description, $content_style, $targe $categories_to_separate = array( 'header', 'footer' ); // Choose random categories for the generated patterns and return foreach ( $random_homepages as $homepage_index => $slug ) { - $generated_homepages[ $slug ] = array(); - $homepage_patterns = array(); + $generated_homepages[ $slug ] = array(); + $homepage_patterns = array(); + $homepage_patterns['generatedImages'] = array(); foreach ( $generated_content_structures[ $slug ] as $pattern_category ) { if ( empty( $generated_patterns[ $pattern_category ] ) ) { continue; @@ -457,8 +458,6 @@ public static function get_home_pages( $site_description, $content_style, $targe $homepage_patterns['content'] = $homepage_patterns['content'] . $random_pattern['replacedPattern']; } - $homepage_patterns['generatedImages'] = array(); - if ( ! empty( $random_pattern['dalleImages'] ) ) { $homepage_patterns['generatedImages'] = $random_pattern['dalleImages']; }