diff --git a/includes/class-syndication-wp-rss-client.php b/includes/class-syndication-wp-rss-client.php index c07dfb7dc5d4b6a23f65969d9a1508fa4b8bf574..88cf0132de33b1c837d4f551d5151b8764763f44 100644 --- a/includes/class-syndication-wp-rss-client.php +++ b/includes/class-syndication-wp-rss-client.php @@ -223,19 +223,17 @@ class Syndication_WP_RSS_Client extends SimplePie implements Syndication_Client if ( isset( $result->term_id ) ) { $ids['cats'][] = $result->term_id; } + } elseif ( $result = get_term_by( 'name', $cat->term, 'post_tag' ) ) { + if ( isset( $result->term_id ) ) { + $ids['tags'][] = $result->term_id; + } } else { - 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; - } - } - } + // creates if not + $result = wp_insert_term( $cat->term, 'category' ); + if ( isset( $result->term_id ) ) { + $ids['cats'][] = $result->term_id; + } + } } // returns array ready for post creation