Skip to content

Commit c9e0f1b

Browse files
committed
Disable updates from GitHub when in WP.org mode
WordPress.org build updates from WordPress.org repo. GitHub build updates from GitHub releases.
1 parent 064010b commit c9e0f1b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Controller.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ public static function init(): Controller {
4646
}
4747

4848
WordPressAdmin::registerHooks();
49-
WordPressAdmin::buildUpdateChecker( $bootstrap_file );
49+
50+
if ( ! defined( 'STATIC_DEPLOY_WP_ORG_MODE' ) || ! STATIC_DEPLOY_WP_ORG_MODE ) {
51+
WordPressAdmin::buildUpdateChecker( $bootstrap_file );
52+
}
53+
5054
WordPressAdmin::addAdminUIElements();
5155

5256
Utils::setMaxExecutionTime();

src/WordPressAdmin.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ class WordPressAdmin {
1919
* @param string $bootstrap_file main plugin filepath
2020
*/
2121
public static function buildUpdateChecker( string $bootstrap_file ): void {
22+
if ( defined( 'STATIC_DEPLOY_WP_ORG_MODE' ) && STATIC_DEPLOY_WP_ORG_MODE ) {
23+
return;
24+
}
25+
2226
PucFactory::buildUpdateChecker(
2327
// phpcs:disable Generic.Files.LineLength
2428
'https://raw.githubusercontent.com/staticweb-io/static-deploy/refs/heads/develop/update.json',

0 commit comments

Comments
 (0)