classifai
classifai copied to clipboard
Terms/Tags are not getting created correctly when we select common taxonomy between enabled features.
Describe the bug
During working on e2e using cypress PR(https://github.com/10up/classifai/pull/334), I noticed that when we select common taxonomy between enabled features, then terms/tags are not getting created correctly. Created terms/tags are not the combinations of the terms of the selected features instead it gets overwritten and ended up creating terms/tags of the only one feature. Please check screenshots for more information.
Based on the initial investigation this is happening because wp_set_object_terms
overwrites terms/tags linked by other features
https://github.com/10up/classifai/blob/develop/includes/Classifai/Watson/Linker.php#L116.
Steps to Reproduce
- Go to
ClassifAI
>Language Processing
and setup API credentials - Enable All features (category, keywords, etc...) and assign related Watson taxonomy to each feature.
- Create a post and note the terms created in each taxonomy.
- Go to Language Processing settings and update "Tag" as a taxonomy for each feature.
- Update a post created in step 3, check created tags. Created tags should be a combination of all terms created in step 3, but only a few tags are getting created.
Screenshots, screen recording, code snippet
Separate taxonomy for each features | Common taxonomy between features |
---|---|
![]() |
![]() |
Environment information
No response
WordPress information
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct