-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuninstall.php
38 lines (29 loc) · 885 Bytes
/
uninstall.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* Tasks to run during uninstallation of this plugin.
*
* @package personio-integration-light
*/
use PersonioIntegrationLight\Plugin\Uninstaller;
// if uninstall.php is not called by WordPress, die.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
// prevent direct access.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// do nothing if PHP-version is not 8.0 or newer.
if ( version_compare( PHP_VERSION, '8.0', '<' ) ) {
return;
}
// set version number.
define( 'WP_PERSONIO_INTEGRATION_VERSION', '@@VersionNumber@@' );
// save plugin-path.
define( 'WP_PERSONIO_INTEGRATION_PLUGIN', __FILE__ );
// get autoloader generated by composer.
require_once __DIR__ . '/vendor/autoload.php';
// include necessary files.
require 'inc/constants.php';
// run uninstaller.
Uninstaller::get_instance()->run( array( get_option( 'personioIntegrationDeleteOnUninstall', 0 ) ) );