Skip to content
Snippets Groups Projects
Commit 23cc47ab authored by Jackreichert's avatar Jackreichert
Browse files

Code Stylistic Change

Reversed the condition to prevent a negative condition.
parent 6628695d
No related branches found
No related tags found
No related merge requests found
...@@ -219,7 +219,11 @@ class Syndication_WP_RSS_Client extends SimplePie implements Syndication_Client ...@@ -219,7 +219,11 @@ class Syndication_WP_RSS_Client extends SimplePie implements Syndication_Client
foreach ( $cats as $cat ) { foreach ( $cats as $cat ) {
// checks if term exists // 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' ) ) { if ( ! $result = get_term_by( 'name', $cat->term, 'post_tag' ) ) {
// creates if not // creates if not
$result = wp_insert_term( $cat->term, 'category' ); $result = wp_insert_term( $cat->term, 'category' );
...@@ -231,11 +235,7 @@ class Syndication_WP_RSS_Client extends SimplePie implements Syndication_Client ...@@ -231,11 +235,7 @@ class Syndication_WP_RSS_Client extends SimplePie implements Syndication_Client
$ids['tags'][] = $result->term_id; $ids['tags'][] = $result->term_id;
} }
} }
} else { }
if ( isset( $result->term_id ) ) {
$ids['cats'][] = $result->term_id;
}
}
} }
// returns array ready for post creation // returns array ready for post creation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment