Skip to content

Commit

Permalink
Fix parsing of categories from xml feed
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRAoW authored Jun 19, 2018
1 parent 012baef commit 65ec357
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Parser/ItemTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,15 @@ public function getValue()
$value = $feedItem->get_author()->get_name();
break;
case 'categories':
$value = implode(', ', $feedItem->get_categories());
$categories = $feedItem->get_categories();
$categoriesList = [];

if (!empty($categories)) foreach ($categories as $category)
{
$categoriesList[] = $category->get_label();
}

$value = implode(', ', $categoriesList);
break;
case 'image':
$enclosure = $feedItem->get_enclosure();
Expand Down

0 comments on commit 65ec357

Please sign in to comment.