diff --git a/includes/SiteGen/SiteGen.php b/includes/SiteGen/SiteGen.php index 2879002..97e0afb 100644 --- a/includes/SiteGen/SiteGen.php +++ b/includes/SiteGen/SiteGen.php @@ -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 ) { @@ -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 );