You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
wp post term remove reports success when the term is not assigned #691
wp post term remove prints Success even when nothing was removed:
$ wp post term add 1 post_tag apple
$ wp term create post_tag banana
$ wp post term remove 1 post_tag banana
Success: Removed term.
banana was never assigned to post 1. wp_remove_object_terms() returns false when no relationship was deleted, and WP_Error only for an invalid taxonomy or term lookup error. CommandWithTerms::remove() checks only is_wp_error(), so false falls through to the success message. wp user term remove uses the same class.
Expected: an error with a non-zero exit code, the same as wp post meta delete on a key that is not set (Error: Failed to delete custom field.).
Activity