PluginProbe
Polylang / 2.8
Polylang v2.8
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 +20 -1 3.0.22.8 View file →
@@ -51,8 +51,20 @@
51 51 global $wpdb;
52 52
53 53 do_action( 'pll_uninstall' );
54 54
55 + // Suppress data of the old model < 1.2
56 + // FIXME: to remove when support for v1.1.6 will be dropped
57 + $wpdb->termmeta = $wpdb->prefix . 'termmeta'; // registers the termmeta table in wpdb
58 +
59 + // Do nothing if the termmeta table does not exists
60 + if ( count( $wpdb->get_results( "SHOW TABLES LIKE '$wpdb->termmeta'" ) ) ) {
61 + $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_translations'" );
62 + $wpdb->query( "DELETE FROM $wpdb->termmeta WHERE meta_key = '_language'" );
63 + $wpdb->query( "DELETE FROM $wpdb->termmeta WHERE meta_key = '_rtl'" );
64 + $wpdb->query( "DELETE FROM $wpdb->termmeta WHERE meta_key = '_translations'" );
65 + }
66 +
55 67 // Need to register the taxonomies
56 68 $pll_taxonomies = array( 'language', 'term_language', 'post_translations', 'term_translations' );
57 69 foreach ( $pll_taxonomies as $taxonomy ) {
58 70 register_taxonomy( $taxonomy, null, array( 'label' => false, 'public' => false, 'query_var' => false, 'rewrite' => false ) );
@@ -83,9 +95,15 @@
83 95 foreach ( $ids as $id ) {
84 96 wp_delete_post( $id, true );
85 97 }
86 98
87 - // Delete the strings translations.
99 + // Delete the strings translations ( <1.2 )
100 + // FIXME: to remove when support for v1.1.6 will be dropped
101 + foreach ( $languages as $lang ) {
102 + delete_option( 'polylang_mo' . $lang->term_id );
103 + }
104 +
105 + // Delete the strings translations 1.2+
88 106 register_post_type( 'polylang_mo', array( 'rewrite' => false, 'query_var' => false ) );
89 107 $ids = get_posts(
90 108 array(
91 109 'post_type' => 'polylang_mo',
@@ -127,8 +145,9 @@
127 145 delete_option( 'pll_dismissed_notices' );
128 146
129 147 // Delete transients
130 148 delete_transient( 'pll_languages_list' );
149 + delete_transient( 'pll_upgrade_1_4' );
131 150 }
132 151 }
133 152
134 153 new PLL_Uninstall();