From 23cc47abcf095735a7757768a70818347a64d591 Mon Sep 17 00:00:00 2001
From: Jackreichert <jack@jackreichert.com>
Date: Tue, 20 May 2014 20:16:42 -0400
Subject: [PATCH] Code Stylistic Change

Reversed the condition to prevent a negative condition.
---
 includes/class-syndication-wp-rss-client.php | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/includes/class-syndication-wp-rss-client.php b/includes/class-syndication-wp-rss-client.php
index 3f1e7d4..e403731 100644
--- a/includes/class-syndication-wp-rss-client.php
+++ b/includes/class-syndication-wp-rss-client.php
@@ -219,7 +219,11 @@ class Syndication_WP_RSS_Client extends SimplePie implements Syndication_Client
 
 		foreach ( $cats as $cat ) {
 			// checks if term exists
-			if ( ! $result = get_term_by( 'name', $cat->term, 'category' ) ) {
+			if ( $result = get_term_by( 'name', $cat->term, 'category' ) ) {
+				if ( isset( $result->term_id ) ) {
+					$ids['cats'][] = $result->term_id;
+				}
+			} else {
 				if ( ! $result = get_term_by( 'name', $cat->term, 'post_tag' ) ) {
 					// creates if not
 					$result = wp_insert_term( $cat->term, 'category' );
@@ -231,11 +235,7 @@ class Syndication_WP_RSS_Client extends SimplePie implements Syndication_Client
 						$ids['tags'][] = $result->term_id;
 					}
 				}
-			} else {
-				if ( isset( $result->term_id ) ) {
-					$ids['cats'][] = $result->term_id;
-				}
-			}               
+			} 
 		}
 
 		// returns array ready for post creation
-- 
GitLab