From e98e90bceadf43ade82937fadd0f6ce13e987f85 Mon Sep 17 00:00:00 2001 From: Jackreichert <jack@jackreichert.com> Date: Tue, 20 May 2014 20:31:44 -0400 Subject: [PATCH] Logic fix Removing negative conditions. --- includes/class-syndication-wp-rss-client.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/class-syndication-wp-rss-client.php b/includes/class-syndication-wp-rss-client.php index 2733122..c07dfb7 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; - } } } } -- GitLab