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