'heraldly_bar', 'posts_per_page' => -1, 'post_status' => 'any', 'fields' => 'ids', ) ); foreach ( $heraldly_bar_ids as $heraldly_bar_id ) { wp_delete_post( $heraldly_bar_id, true ); } // Delete options. delete_option( 'heraldly_db_version' ); delete_option( 'heraldly_geo_options' ); // Cached geo lookups (heraldly_geo_{md5(ip)} transients) expire on their own // within a week; they are deliberately not swept here with a LIKE query. // Drop the leads table. $heraldly_table = $wpdb->prefix . 'heraldly_leads'; $wpdb->query( $wpdb->prepare( 'DROP TABLE IF EXISTS %i', $heraldly_table ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- Removing the plugin's own table on uninstall.