From 3ee525998cbe78b307c7463bb77e43c22b22a86b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Nunes?= Date: Thu, 31 Oct 2019 15:45:27 -0300 Subject: [PATCH] resolve the exporter a array IDs of relationships #328 --- src/exporter/class-tainacan-csv.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/exporter/class-tainacan-csv.php b/src/exporter/class-tainacan-csv.php index ea1b82ee9..16b9d6148 100644 --- a/src/exporter/class-tainacan-csv.php +++ b/src/exporter/class-tainacan-csv.php @@ -44,9 +44,13 @@ class CSV extends Exporter { continue; } - if ($meta->get_metadatum()->get_metadata_type() == 'Tainacan\Metadata_Types\Relationship') - $line[] = $meta->get_value(); - else + if ($meta->get_metadatum()->get_metadata_type() == 'Tainacan\Metadata_Types\Relationship') { + $rel = $meta->get_value(); + if (is_array($rel)) + $line[] = implode( $this->get_option('multivalued_delimiter'), $rel ); + else + $line[] = $rel; + } else $line[] = $meta->get_value_as_string(); }