'acscf_entry', 'post_status' => 'any', 'posts_per_page' => -1, 'fields' => 'ids', ) ); foreach ( $acscf_entry_ids as $acscf_entry_id ) { wp_delete_post( $acscf_entry_id, true ); } // Form definitions. $acscf_form_ids = get_posts( array( 'post_type' => 'acscf_form', 'post_status' => 'any', 'posts_per_page' => -1, 'fields' => 'ids', ) ); foreach ( $acscf_form_ids as $acscf_form_id ) { wp_delete_post( $acscf_form_id, true ); } // Attachment storage. $acscf_uploads = wp_upload_dir(); $acscf_dir = trailingslashit( $acscf_uploads['basedir'] ) . 'acs-contact-form'; if ( is_dir( $acscf_dir ) ) { global $wp_filesystem; if ( ! function_exists( 'WP_Filesystem' ) ) { require_once ABSPATH . 'wp-admin/includes/file.php'; } WP_Filesystem(); if ( $wp_filesystem ) { $wp_filesystem->delete( $acscf_dir, true ); } } // Options and scheduled events, including the ones left by versions before 2.0.2. delete_option( 'acscf_settings' ); delete_option( 'acscf_ai_settings' ); delete_option( 'acscf_version' ); delete_option( 'acscf_db_version' ); delete_option( 'acscf_migration_notice' ); delete_option( 'acs_cf_settings' ); delete_option( 'acs_cf_ai_settings' ); delete_option( 'acs_cf_version' ); delete_transient( 'acscf_update_check' ); delete_transient( 'acs_cf_update_check' ); wp_clear_scheduled_hook( 'acscf_stale_alert' ); wp_clear_scheduled_hook( 'acs_cf_stale_alert' );