Skip to content

Commit 5168c1f

Browse files
owolterwestonruter
authored andcommitted
https://core.trac.wordpress.org/attachment/ticket/64406/taxonomy-error-handling.patch
1 parent 48b2b65 commit 5168c1f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/wp-includes/taxonomy.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,6 +1999,10 @@ function wp_delete_object_term_relationships( $object_id, $taxonomies ) {
19991999

20002000
foreach ( (array) $taxonomies as $taxonomy ) {
20012001
$term_ids = wp_get_object_terms( $object_id, $taxonomy, array( 'fields' => 'ids' ) );
2002+
if ( is_wp_error( $term_ids ) ) {
2003+
// Skip this taxonomy if it returns an error
2004+
continue;
2005+
}
20022006
$term_ids = array_map( 'intval', $term_ids );
20032007
wp_remove_object_terms( $object_id, $term_ids, $taxonomy );
20042008
}

0 commit comments

Comments
 (0)