Skip to content

Commit

Permalink
Merge pull request #13 from newfold-labs/sitegen
Browse files Browse the repository at this point in the history
Sitegen
  • Loading branch information
amartya-dev authored Dec 18, 2023
2 parents a99592c + fd44bf5 commit d1a7fde
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion includes/SiteGen/SiteGen.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,11 @@ public static function generate_site_meta( $site_info, $identifier, $skip_cache
* @param boolean $regenerate If we need to regenerate.
*/
public static function get_home_pages( $site_description, $content_style, $target_audience, $regenerate = false ) {
if ( ! self::check_capabilities() ) {
return array(
'error' => __( 'You do not have the permissions to perform this action' ),
);
}

// Check if we have the response in cache already
if ( ! $regenerate ) {
Expand Down Expand Up @@ -402,7 +407,6 @@ public static function get_home_pages( $site_description, $content_style, $targe
self::cache_sitegen_response( 'contentStructures', $generated_content_structures );
self::cache_sitegen_response( 'generatedPatterns', $generated_patterns );
self::cache_sitegen_response( 'homepages', $generated_homepages );
return $generated_homepages;
}

$random_homepages = array_rand( $generated_content_structures, 3 );
Expand Down

0 comments on commit d1a7fde

Please sign in to comment.