Skip to content

Commit a17cf24

Browse files
fix(lite-site): skip module init when Lite Site plugin is active (#4720)
1 parent 36fa70c commit a17cf24

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

includes/lite-site/class-lite-site.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ class Lite_Site {
2020
* Initialize the lite site functionality
2121
*/
2222
public static function init() {
23+
// The standalone Newspack Lite Site plugin supersedes this module, so skip initialization to avoid conflicts.
24+
if ( defined( 'NEWSPACK_LITE_SITE_PLUGIN_FILE' ) ) {
25+
return;
26+
}
27+
2328
// Only register rewrite rules if the feature is enabled.
2429
if ( self::is_enabled() ) {
2530
add_action( 'init', [ __CLASS__, 'register_rewrite_rules' ] );
@@ -525,5 +530,4 @@ function gtag(){dataLayer.push(arguments);}
525530
}
526531
}
527532

528-
// Initialize the class.
529-
Lite_Site::init();
533+
add_action( 'plugins_loaded', [ Lite_Site::class, 'init' ] );

0 commit comments

Comments
 (0)