Skip to content

Fixes fetching terms on XML-RPC disabled sites#25767

Open
crazytonyli wants to merge 3 commits into
trunkfrom
bugfix/selfhosted-taxonomy-rest
Open

Fixes fetching terms on XML-RPC disabled sites#25767
crazytonyli wants to merge 3 commits into
trunkfrom
bugfix/selfhosted-taxonomy-rest

Conversation

@crazytonyli

Copy link
Copy Markdown
Contributor

Note

I recommend reviewing this PR commit by commit: the first commit is the fix, the second is a TagsViewModel construction cleanup.

Description

Fixes #25758.

I thought the tags (and custom terms) selection screen uses core REST API when available. But that is not the case. My misunderstanding probably comes from the TagsViewModel initialisers being a bit messy. The tags selection type names need a bit more cleanup, due to how it's expanded from tags-only to all terms.

The second commit cleans up the area a little bit. But there are more can be done.

Testing instructions

Disable XML-RPC on a self-hosted site, open a new post's Post Settings and confirm Categories and Tags load, can be selected, and new ones can be created.

Self-hosted taxonomy went through XML-RPC term methods, which some hosts block at the WAF, breaking tags and categories on new posts (#25758). Prefer the core REST API (wp/v2) whenever the site has application-password access, keeping XML-RPC only as a fallback for legacy sites without it.
The two convenience initializers were ambiguous about when to use each. Introduce tags(for:) and taxonomy(_:client:) so call sites read by intent, and drop the unused blog parameter that was threaded through the custom taxonomy path.
@crazytonyli crazytonyli added this to the 27.1 milestone Jul 9, 2026
@crazytonyli crazytonyli requested a review from jkmassel July 9, 2026 07:37
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.

Generated by 🚫 Danger

@wpmobilebot

Copy link
Copy Markdown
Contributor
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 Number33092
VersionPR #25767
Bundle IDorg.wordpress.alpha
Commitbfdb97a
Installation URL3rf22jb7vfnqg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

Copy link
Copy Markdown
Contributor
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 Number33092
VersionPR #25767
Bundle IDcom.jetpack.alpha
Commitbfdb97a
Installation URL4kcd2fsftjkao
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

TaxonomyServiceRemoteCoreREST *coreREST = [[TaxonomyServiceRemoteCoreREST alloc] initWithBlog:blog];
if (coreREST) {
return coreREST;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just a reminder to myself: we need to make sure categories can be fully fetched, especially on atomic sites(I think?).

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.

Categories and Tags not working for new posts on self-hosted sites (iOS app)

3 participants