__( 'Language', 'polylang-wc' ), 'translations' => __( 'Translation group', 'polylang-wc' ), ) ); } /** * Exports the product language and translation group. * Hooked to the filter 'woocommerce_product_export_row_data'. * * @since 0.8 * * @param array $row Data exported in a CSV row. * @param WC_Product $product Product. * @return array */ public function row_data( $row, $product ) { /** @var PLLWC_Product_Language_CPT */ $data_store = PLLWC_Data_Store::load( 'product_language' ); $id = $product->get_id(); if ( isset( $row['language'] ) ) { $row['language'] = $data_store->get_language( $id ); } if ( isset( $row['translations'] ) ) { $row['translations'] = $data_store->get_translation_group_name( $id ); } return $row; } }