PluginProbe
Polylang / 2.7.3
Polylang v2.7.3
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | uninstall.php +12 -4 2.92.7.3 View file →
@@ -1,8 +1,5 @@
1 1 <?php
2 -/**
3 - * @package Polylang
4 - */
5 2
6 3 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { // If uninstall not called from WordPress exit
7 4 exit;
8 5 }
@@ -49,9 +46,20 @@
49 46 */
50 47 public function uninstall() {
51 48 global $wpdb;
52 49
53 - do_action( 'pll_uninstall' );
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();
54 62
55 63 // Suppress data of the old model < 1.2
56 64 // FIXME: to remove when support for v1.1.6 will be dropped
57 65 $wpdb->termmeta = $wpdb->prefix . 'termmeta'; // registers the termmeta table in wpdb