Repository navigation
Post Settings: Support custom taxonomies - #24964
Conversation
Generated by 🚫 Danger |
| public var format: String? | ||
| public var isSticky = false | ||
| public var tags: [String] = [] | ||
| public var otherTerms: [String: [String]] = [:] |
There was a problem hiding this comment.
@kean I need to add similar code, like updating the new otherTerms variable, assigning its value to another instance, etc. I don't think I missed any places. But can you pay extra attention to reviewing this part? Thanks!
There was a problem hiding this comment.
(nit) it looks good, but it might be worth adding a convenience terms property/method that would combine tags and other terms to remove some duplication and also simplify encoding.
There was a problem hiding this comment.
The duplication is across two types: RemotePostUpdateParameters and RemotePostCreateParameters, and different encoders (and keys) for XMLRPC and REST API. I'll leave the code as it is for now, for simplicity.
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 29646 | |
| Version | PR #24964 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | a90d52e | |
| Installation URL | 3hv4vieoaevf8 |
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 29646 | |
| Version | PR #24964 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | a90d52e | |
| Installation URL | 6hvnhsepqhrt8 |
bb51980 to
ad86748
Compare
| public var format: String? | ||
| public var isSticky = false | ||
| public var tags: [String] = [] | ||
| public var otherTerms: [String: [String]] = [:] |
There was a problem hiding this comment.
(nit) it looks good, but it might be worth adding a convenience terms property/method that would combine tags and other terms to remove some duplication and also simplify encoding.
| return self; | ||
| } | ||
|
|
||
| + (BOOL)compareOtherTerms:(NSDictionary<NSString *, NSArray<NSString *> *> *)lhs withAnother:(NSDictionary<NSString *, NSArray<NSString *> *> *)rhs |
There was a problem hiding this comment.
(nit) It looks like it's only used from Swift. It would be great to implement it in Swift as well if possible.
| @property (nonatomic, strong) NSArray *categories; | ||
| @property (nonatomic, strong) NSArray *revisions; | ||
| @property (nonatomic, strong) NSArray *tags; | ||
| //@property (nonatomic, strong) NSArray<RemotePostTerm *> *otherTerms; |
|
|
||
| private enum Strings { | ||
| static let tags = NSLocalizedString( | ||
| "Tags", |
There was a problem hiding this comment.
I reused the existing translation for "Tags", considering it's a pretty common term.
ad86748 to
a71460b
Compare
|
This is a regression introduced in #24964. We should not check if values are an empty list in the "update" parameter types.
This is a regression introduced in #24964. We should not check if values are an empty list in the "update" parameter types.
This is a regression introduced in #24964. We should not check if values are an empty list in the "update" parameter types.
* Bump version number * Fix CMM-1065: Find existing tag before creating a new one (#25061) * Fix CMM-1065: Find existing tag before creating a new one The issue was introduced in #24955. * Replace original input with the actual tag * Invert a boolean check of most recently used tags first (#25065) The issue was introduced in #24955. I missed a `!` in the refactor. * Fix an issue where the app fails to remove tags from posts (#25067) This is a regression introduced in #24964. We should not check if values are an empty list in the "update" parameter types. * Move finding existing tag code (#25068) Moving the code to the view model, so that it can cover tags and custom taxonomy terms, which are two seperate `TagsServiceProtocol` implementations. * Clear the tag input field after tapping the Enter key (#25069) We already have code that clears the text field in the `addTag` function. However, during testing, I noticed it does not always work. The new change here makes sure the `UITextField` is cleared, because we are calling the UIKit directly, instead of relying on SwiftUI to pass the `text` changes to UIKit. * Manually bump version number --------- Co-authored-by: Tony Li <tony.li@automattic.com>





Description
This PR allows updating the terms of custom taxonomies in posts. The feature requires application passwords and works on all sites where custom taxonomies are available.
Testing instructions
Verify all terms (including tags and categories) can be updated.