Skip to content

Commit

Permalink
Remove duplication of wp_delete_object_term_relationships
Browse files Browse the repository at this point in the history
  • Loading branch information
jopdop30 committed Feb 20, 2025
1 parent da91af4 commit dfa84c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -6370,7 +6370,7 @@ function wp_delete_attachment( $post_id, $force_delete = false ) {
do_action( 'delete_attachment', $post_id, $post );

// Delete relationships for category and post tag if they exist.
wp_delete_object_term_relationships( $post_id );
wp_delete_object_term_relationships( $post_id, array_merge( get_object_taxonomies( $post->post_type ), array( 'category', 'post_tag' ) ) );

// Delete all for any posts.
delete_metadata( 'post', null, '_thumbnail_id', $post_id, true );
Expand Down

0 comments on commit dfa84c0

Please sign in to comment.