Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Syndication
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
WP Plugins
Syndication
Commits
23cc47ab
Commit
23cc47ab
authored
11 years ago
by
Jackreichert
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
includes/class-syndication-wp-rss-client.php
+6
-6
6 additions, 6 deletions
includes/class-syndication-wp-rss-client.php
with
6 additions
and
6 deletions
includes/class-syndication-wp-rss-client.php
+
6
−
6
View file @
23cc47ab
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment