generateTaxRateSteps( 'wc_tax_rate_classes' ), ...$this->generateTaxRateSteps( 'woocommerce_tax_rates' ), ...$this->generateTaxRateSteps( 'woocommerce_tax_rate_locations' ), ); } /** * Return label used in the frontend. * * @return string */ public function get_label() { return __( 'Tax', 'woocommerce' ); } /** * Return description used in the frontend. * * @return string */ public function get_description() { return __( 'Includes all settings in WooCommerce | Settings | Tax.', 'woocommerce' ); } /** * Get the page ID for the settings page. * * @return string */ protected function get_page_id(): string { return 'tax'; } /** * Generate SQL steps for exporting data. * * @param string $table Table identifier. * @return array Array of RunSql steps. */ private function generateTaxRateSteps( string $table ): array { global $wpdb; $prefixed_table = $wpdb->prefix . $table; return array_map( fn( $record ) => RunSql::from_table_row( $record, $table ), $wpdb->get_results( $wpdb->prepare( 'SELECT * FROM %i', $prefixed_table ), ARRAY_A ), ); } }