-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Post Settings: Support custom taxonomies #24964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(nit) It looks like it's only used from Swift. It would be great to implement it in Swift as well if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in a71460b.
| @property (nonatomic, strong) NSArray *categories; | ||
| @property (nonatomic, strong) NSArray *revisions; | ||
| @property (nonatomic, strong) NSArray *tags; | ||
| //@property (nonatomic, strong) NSArray<RemotePostTerm *> *otherTerms; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented out code.
|
|
||
| private enum Strings { | ||
| static let tags = NSLocalizedString( | ||
| "Tags", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(nit ) should use namespacig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reused the existing translation for "Tags", considering it's a pretty common term.
ad86748 to
a71460b
Compare
|





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.