Skip to content

Commit

Permalink
check for keywords before looping.
Browse files Browse the repository at this point in the history
  • Loading branch information
padams committed Nov 10, 2020
1 parent 0ca8abb commit b1f5345
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions modules/metadata/XmpReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,19 @@ public function registerShortcuts( $value = '', $tag, $xmp ) {
$child_taxonomy_delimiter = pp_api::getOption('core', 'metadata', 'custom_taxonomies_tag_delimiter') ?: ':';

// drop keywords uses as child taxonomies.
foreach ( $keywords as $k => $v ) {

if ( $keywords ) {

if ( ! strpos($v, $child_taxonomy_delimiter ) ) {
foreach ( $keywords as $k => $v ) {

$nkeywords[] = $v;
if ( ! strpos($v, $child_taxonomy_delimiter ) ) {

$nkeywords[] = $v;
}
}

return implode( ', ', $nkeywords);
}

return implode( ', ', $nkeywords);
}
}

Expand Down

0 comments on commit b1f5345

Please sign in to comment.