Skip to content

Commit ee53cb4

Browse files
Coding Standards: Remove redundant ! empty() check in is_object_in_term().
If `$object_terms` is empty, the immediately preceding code block causes the function to return early. Follow-up to [8131], [10159]. Props justlevine. See #63268. git-svn-id: https://develop.svn.wordpress.org/trunk@60282 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 32469f1 commit ee53cb4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/wp-includes/taxonomy.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4898,11 +4898,13 @@ function is_object_in_term( $object_id, $taxonomy, $terms = null ) {
48984898
if ( is_wp_error( $object_terms ) ) {
48994899
return $object_terms;
49004900
}
4901+
49014902
if ( empty( $object_terms ) ) {
49024903
return false;
49034904
}
4905+
49044906
if ( empty( $terms ) ) {
4905-
return ( ! empty( $object_terms ) );
4907+
return true;
49064908
}
49074909

49084910
$terms = (array) $terms;

0 commit comments

Comments
 (0)