Skip to content
Permalink
Browse files

apply filter no hierarchy separator for CSV exporter #283

  • Loading branch information...
leogermani committed Jul 30, 2019
1 parent 16b2c91 commit 4cb4354b28ee4157697fb634eccd0d9eff8b23e1
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/exporter/class-tainacan-csv.php
@@ -21,6 +21,10 @@ public function __construct($attributes = array()) {
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 @@ public function process_item( $item, $metadata ) {
$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 @@ public function process_item( $item, $metadata ) {
}
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();

0 comments on commit 4cb4354

Please sign in to comment.
You can’t perform that action at this time.