Skip to content

Conversation

@crazytonyli
Copy link
Contributor

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.

@crazytonyli crazytonyli added this to the 26.5 milestone Oct 30, 2025
@crazytonyli crazytonyli requested a review from kean October 30, 2025 22:43
@dangermattic
Copy link
Collaborator

2 Warnings
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

public var format: String?
public var isSticky = false
public var tags: [String] = []
public var otherTerms: [String: [String]] = [:]
Copy link
Contributor Author

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!

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Oct 30, 2025

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number29646
VersionPR #24964
Bundle IDorg.wordpress.alpha
Commita90d52e
Installation URL3hv4vieoaevf8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Oct 30, 2025

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number29646
VersionPR #24964
Bundle IDcom.jetpack.alpha
Commita90d52e
Installation URL6hvnhsepqhrt8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@crazytonyli crazytonyli force-pushed the taxonomies/add-custom-terms-post-settings branch 2 times, most recently from bb51980 to ad86748 Compare November 3, 2025 01:41
public var format: String?
public var isSticky = false
public var tags: [String] = []
public var otherTerms: [String: [String]] = [:]
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor Author

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;
Copy link
Contributor

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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit ) should use namespacig

Copy link
Contributor Author

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.

@crazytonyli crazytonyli force-pushed the taxonomies/add-custom-terms-post-settings branch from ad86748 to a71460b Compare November 4, 2025 02:21
@crazytonyli crazytonyli enabled auto-merge November 4, 2025 02:24
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 4, 2025

@crazytonyli crazytonyli added this pull request to the merge queue Nov 4, 2025
Merged via the queue into trunk with commit a252e96 Nov 4, 2025
30 of 32 checks passed
@crazytonyli crazytonyli deleted the taxonomies/add-custom-terms-post-settings branch November 4, 2025 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants