Skip to content

Commit 417b389

Browse files
committed
Ensure term_id property exists on object
1 parent b00dde1 commit 417b389

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/wp-includes/taxonomy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1723,7 +1723,7 @@ function sanitize_term( $term, $taxonomy, $context = 'display' ) {
17231723

17241724
$do_object = is_object( $term );
17251725

1726-
$term_id = $do_object ? $term->term_id : ( $term['term_id'] ?? 0 );
1726+
$term_id = $do_object ? ( $term->term_id ?? 0 ) : ( $term['term_id'] ?? 0 );
17271727

17281728
foreach ( (array) $fields as $field ) {
17291729
if ( $do_object ) {

0 commit comments

Comments
 (0)