Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#41747 closed defect (bug) (invalid)

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

Reported by: henrywright's profile 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
7 years ago

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

I retested this and old tags are replaced. Closing.

#2 @SergeyBiryukov
7 years ago

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