Skip to content

Commit a8cb27e

Browse files
committed
- update logic to also check if $append is true
1 parent c1fbe2f commit a8cb27e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Data/PostObjectMutation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ protected static function set_object_terms( int $post_id, array $input, WP_Post_
355355
return;
356356
}
357357

358-
if ( 'category' === $tax_object->name ) {
358+
if ( $append && 'category' === $tax_object->name ) {
359359
$default_category_id = absint( get_option( 'default_category' ) );
360360
if ( ! in_array( $default_category_id, $terms_to_connect, true ) ) {
361361
wp_remove_object_terms( $post_id, $default_category_id, 'category' );

0 commit comments

Comments
 (0)