From 0dcbb5b02d7e0925447719045e35bcf3004887f0 Mon Sep 17 00:00:00 2001 From: Jake Spurlock Date: Tue, 7 Jul 2020 03:53:14 +0000 Subject: [PATCH] Coding standards: Fix a few phpcs errors to get tests passing. See [48356], #43517. git-svn-id: https://develop.svn.wordpress.org/trunk@48358 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/taxonomy.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index 3a89d641db..e0acadcf87 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -442,7 +442,8 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) { // Add default term. if ( ! empty( $taxonomy_object->default_term ) ) { - if ( $term = term_exists( $taxonomy_object->default_term['name'], $taxonomy ) ) { + $term = term_exists( $taxonomy_object->default_term['name'], $taxonomy ); + if ( $term ) { update_option( 'default_taxonomy_' . $taxonomy_object->name, $term['term_id'] ); } else { $term = wp_insert_term( @@ -2515,7 +2516,8 @@ function wp_set_object_terms( $object_id, $terms, $taxonomy, $append = false ) { $taxonomy_obj = get_taxonomy( $taxonomy ); // Default term for this taxonomy. - if ( empty( $terms ) && ! empty( $taxonomy_obj->default_term ) && ! empty( $default_term_id = get_option( 'default_taxonomy_' . $taxonomy ) ) ) { + $default_term_id = get_option( 'default_taxonomy_' . $taxonomy ); + if ( empty( $terms ) && ! empty( $taxonomy_obj->default_term ) && ! empty( $default_term_id ) ) { $terms[] = (int) $default_term_id; }