contact-form-7
Last commit date
admin
6 months ago
assets
5 years ago
includes
2 weeks ago
languages
9 years ago
modules
6 months ago
license.txt
7 months ago
load.php
11 months ago
readme.txt
2 weeks ago
uninstall.php
11 months ago
wp-contact-form-7.php
2 weeks ago
uninstall.php
35 lines
| 1 | <?php |
| 2 | |
| 3 | if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
| 4 | exit(); |
| 5 | } |
| 6 | |
| 7 | function wpcf7_delete_plugin() { |
| 8 | global $wpdb; |
| 9 | |
| 10 | delete_option( 'wpcf7' ); |
| 11 | |
| 12 | $posts = get_posts( |
| 13 | array( |
| 14 | 'numberposts' => -1, |
| 15 | 'post_type' => 'wpcf7_contact_form', |
| 16 | 'post_status' => 'any', |
| 17 | ) |
| 18 | ); |
| 19 | |
| 20 | foreach ( $posts as $post ) { |
| 21 | wp_delete_post( $post->ID, true ); |
| 22 | } |
| 23 | |
| 24 | $wpdb->query( $wpdb->prepare( |
| 25 | "DROP TABLE IF EXISTS %i", |
| 26 | $wpdb->prefix . 'contact_form_7' |
| 27 | ) ); |
| 28 | |
| 29 | return true; |
| 30 | } |
| 31 | |
| 32 | if ( ! defined( 'WPCF7_VERSION' ) ) { |
| 33 | wpcf7_delete_plugin(); |
| 34 | } |
| 35 |