'avca_lead', 'post_status' => 'any', 'posts_per_page' => -1, 'fields' => 'ids', 'no_found_rows' => true, ) ); if ( ! empty( $avca_lead_ids ) ) { foreach ( $avca_lead_ids as $avca_lead_id ) { wp_delete_post( $avca_lead_id, true ); } } // 4. Drop Pro chat history database table. global $wpdb; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.DirectDatabaseQuery.NoCaching -- Removing the plugin's own table on complete uninstall. $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}avcap_messages" );