diff --git a/includes/class-syndication-wp-rss-client.php b/includes/class-syndication-wp-rss-client.php index 2733122824159eca3dfa0175da049c1709fc743f..c07dfb7dc5d4b6a23f65969d9a1508fa4b8bf574 100644 --- a/includes/class-syndication-wp-rss-client.php +++ b/includes/class-syndication-wp-rss-client.php @@ -224,16 +224,16 @@ class Syndication_WP_RSS_Client extends SimplePie implements Syndication_Client $ids['cats'][] = $result->term_id; } } else { - if ( ! $result = get_term_by( 'name', $cat->term, 'post_tag' ) ) { + if ( $result = get_term_by( 'name', $cat->term, 'post_tag' ) ) { + if ( isset( $result->term_id ) ) { + $ids['tags'][] = $result->term_id; + } + } else { // creates if not $result = wp_insert_term( $cat->term, 'category' ); if ( isset( $result->term_id ) ) { $ids['cats'][] = $result->term_id; } - } else { - if ( isset( $result->term_id ) ) { - $ids['tags'][] = $result->term_id; - } } } }