Skip to content

Commit 24f924d

Browse files
committed
Move activation hooks to Controller
1 parent bfd4167 commit 24f924d

2 files changed

Lines changed: 9 additions & 13 deletions

File tree

src/Controller.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,15 @@ public static function getInstance(): Controller {
3535
public static function init( string $bootstrap_file ): Controller {
3636
$plugin_instance = self::getInstance();
3737

38-
WordPressAdmin::registerActivationHooks( $bootstrap_file );
38+
register_activation_hook(
39+
$bootstrap_file,
40+
[ self::class, 'activate' ]
41+
);
42+
43+
register_deactivation_hook(
44+
$bootstrap_file,
45+
[ self::class, 'deactivate' ]
46+
);
3947

4048
if ( ! $plugin_instance->loadAdmin() ) {
4149
return $plugin_instance;

src/WordPressAdmin.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,6 @@ public static function buildUpdateChecker( string $bootstrap_file ): void {
3333
);
3434
}
3535

36-
public static function registerActivationHooks( string $bootstrap_file ): void {
37-
register_activation_hook(
38-
$bootstrap_file,
39-
[ Controller::class, 'activate' ]
40-
);
41-
42-
register_deactivation_hook(
43-
$bootstrap_file,
44-
[ Controller::class, 'deactivate' ]
45-
);
46-
}
47-
4836
/**
4937
* Register hooks for WordPress and plugin actions
5038
*

0 commit comments

Comments
 (0)