| @@ -1,5 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | +/** | |
| 3 | + * @package Polylang | |
| 4 | + */ | |
| 2 | 5 | |
| 3 | 6 | if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { // If uninstall not called from WordPress exit |
| 4 | 7 | exit; |
| 5 | 8 | } |
| @@ -46,20 +49,9 @@ | ||
| 46 | 49 | */ |
| 47 | 50 | public function uninstall() { |
| 48 | 51 | global $wpdb; |
| 49 | 52 | |
| 50 | - // Executes each module's uninstall script, if it exists | |
| 51 | - $pll_modules_dir = dirname( __FILE__ ) . '/modules'; | |
| 52 | - opendir( $pll_modules_dir ); | |
| 53 | - while ( ( $module = readdir() ) != false ) { | |
| 54 | - if ( substr( $module, 0, 1 ) !== '.' ) { | |
| 55 | - $uninstall_script = $pll_modules_dir . '/' . $module . '/uninstall.php'; | |
| 56 | - if ( file_exists( $uninstall_script ) ) { | |
| 57 | - require $uninstall_script; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingVariable | |
| 58 | - } | |
| 59 | - } | |
| 60 | - } | |
| 61 | - closedir(); | |
| 53 | + do_action( 'pll_uninstall' ); | |
| 62 | 54 | |
| 63 | 55 | // Suppress data of the old model < 1.2 |
| 64 | 56 | // FIXME: to remove when support for v1.1.6 will be dropped |
| 65 | 57 | $wpdb->termmeta = $wpdb->prefix . 'termmeta'; // registers the termmeta table in wpdb |