Coding Standards: Simplify the check for parent terms in export_wp().

This is more consistent with similar checks elsewhere in core.

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50699 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2021-04-11 13:42:25 +00:00
parent 808e2f886f
commit d2c95cede3

View File

@ -169,7 +169,7 @@ function export_wp( $args = array() ) {
// Put categories in order with no child going before its parent.
while ( $cat = array_shift( $categories ) ) {
if ( 0 == $cat->parent || isset( $cats[ $cat->parent ] ) ) {
if ( ! $cat->parent || isset( $cats[ $cat->parent ] ) ) {
$cats[ $cat->term_id ] = $cat;
} else {
$categories[] = $cat;
@ -178,7 +178,7 @@ function export_wp( $args = array() ) {
// Put terms in order with no child going before its parent.
while ( $t = array_shift( $custom_terms ) ) {
if ( 0 == $t->parent || isset( $terms[ $t->parent ] ) ) {
if ( ! $t->parent || isset( $terms[ $t->parent ] ) ) {
$terms[ $t->term_id ] = $t;
} else {
$custom_terms[] = $t;