diff --git a/includes/class-invp.php b/includes/class-invp.php index 281acd1..10318e0 100644 --- a/includes/class-invp.php +++ b/includes/class-invp.php @@ -128,16 +128,11 @@ private static function delete_all_inventory_on_blog() { ); $posts = get_posts( $args ); $deleted_count = 0; - $settings = self::settings(); if ( $posts ) { + $settings = self::settings(); foreach ( $posts as $post ) { - // delete the parent post or vehicle. - if ( $settings['skip_trash'] ) { - wp_delete_post( $post->ID, $settings['skip_trash'] ); - } else { - wp_trash_post( $post->ID ); - } + wp_delete_post( $post->ID, $settings['skip_trash'] ); ++$deleted_count; } }