apply filter no hierarchy separator for CSV exporter #283

This commit is contained in:
Leo Germani 2019-07-30 10:11:46 -03:00 committed by Mateus Machado Luna
parent ba3931288c
commit c3e1e6cee6
1 changed files with 6 additions and 0 deletions

View File

@ -21,6 +21,10 @@ class CSV extends Exporter {
public function filter_multivalue_separator($separator) {
return $this->get_option('multivalued_delimiter');
}
public function filter_hierarchy_separator($separator) {
return '>>';
}
public function process_item( $item, $metadata ) {
@ -29,6 +33,7 @@ class CSV extends Exporter {
$line[] = $item->get_id();
add_filter('tainacan-item-metadata-get-multivalue-separator', [$this, 'filter_multivalue_separator']);
add_filter('tainacan-terms-hierarchy-html-separator', [$this, 'filter_hierarchy_separator']);
foreach ($metadata as $meta_key => $meta) {
@ -44,6 +49,7 @@ class CSV extends Exporter {
}
remove_filter('tainacan-item-metadata-get-multivalue-separator', [$this, 'filter_multivalue_separator']);
remove_filter('tainacan-terms-hierarchy-html-separator', [$this, 'filter_hierarchy_separator']);
$line[] = $item->get_status();