Skip to content

Commit

Permalink
fix empty generated images
Browse files Browse the repository at this point in the history
  • Loading branch information
amartya-dev committed Feb 29, 2024
1 parent c8b7764 commit 9910364
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions includes/SiteGen/SiteGen.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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'];
}
Expand Down

0 comments on commit 9910364

Please sign in to comment.