WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#41747 closed defect (bug) (invalid)

wp_set_post_tags() doesn't always replace old tags when $append is false

Reported by: henry.wright Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords:
Focuses: Cc:

Description

If the 3rd argument passed to wp_set_post_tags() is false, new tags will replace old tags.

Imagine if post 42 is currently tagged "foo".

wp_set_post_tags( 42, array( 'bar' ), false );

Post 42 is now tagged "bar".

However, imagine this scenario:

wp_set_post_tags( 42, array(), false );

Post 42 is still tagged "bar".

Change History (2)

#1 @henry.wright
2 years ago

  • Resolution set to invalid
  • Status changed from new to closed

I retested this and old tags are replaced. Closing.

#2 @SergeyBiryukov
2 years ago

  • Component changed from General to Taxonomy
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.