contact-form-7
Last commit date
admin
9 years ago
images
10 years ago
includes
8 years ago
languages
9 years ago
modules
8 years ago
license.txt
9 years ago
readme.txt
8 years ago
settings.php
9 years ago
uninstall.php
9 years ago
wp-contact-form-7.php
8 years ago
uninstall.php
29 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( sprintf( "DROP TABLE IF EXISTS %s", |
| 25 | $wpdb->prefix . 'contact_form_7' ) ); |
| 26 | } |
| 27 | |
| 28 | wpcf7_delete_plugin(); |
| 29 |