-
Notifications
You must be signed in to change notification settings - Fork 3
Unify Posts and Pages Endpoints for Custom Post Type Support #915
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jkmassel
approved these changes
Sep 25, 2025
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.
Tested with the Swift sample app and it works great
oguzkocer
added a commit
that referenced
this pull request
Sep 26, 2025
Update Swift wrapper and example app to use the new unified terms endpoint with TermEndpointType parameter, following the same pattern as the posts unification in PR #915. This enables custom taxonomy support while maintaining backward compatibility for existing categories and tags functionality. Changes: - Update WordPressAPI.swift to use unified terms endpoint - Update Pagination.swift with TypedPaginationAwareExecutor for terms - Add categories and tags examples to Swift demo app - Add AnyTermWithEditContext support in ListViewData - Fix CancellationTests to use new posts API signature
oguzkocer
added a commit
that referenced
this pull request
Sep 26, 2025
Update Swift wrapper and example app to use the new unified terms endpoint with TermEndpointType parameter, following the same pattern as the posts unification in PR #915. This enables custom taxonomy support while maintaining backward compatibility for existing categories and tags functionality. Changes: - Update WordPressAPI.swift to use unified terms endpoint - Update Pagination.swift with TypedPaginationAwareExecutor for terms - Add categories and tags examples to Swift demo app - Add AnyTermWithEditContext support in ListViewData - Fix CancellationTests to use new posts API signature
oguzkocer
added a commit
that referenced
this pull request
Sep 26, 2025
Update Swift wrapper and example app to use the new unified terms endpoint with TermEndpointType parameter, following the same pattern as the posts unification in PR #915. This enables custom taxonomy support while maintaining backward compatibility for existing categories and tags functionality. Changes: - Update WordPressAPI.swift to use unified terms endpoint - Update Pagination.swift with TypedPaginationAwareExecutor for terms - Add categories and tags examples to Swift demo app - Add AnyTermWithEditContext support in ListViewData - Fix CancellationTests to use new posts API signature
oguzkocer
added a commit
that referenced
this pull request
Sep 26, 2025
Update Swift wrapper to use the new unified terms endpoint with TermEndpointType parameter, following the same pattern as the posts unification in PR #915. This enables custom taxonomy support while maintaining backward compatibility for existing categories and tags functionality. Changes: - Update WordPressAPI.swift to use unified terms endpoint - Update Pagination.swift with TypedPaginationAwareExecutor for terms - Add AnyTermWithEditContext support in ListViewData - Fix CancellationTests to use new posts API signature
oguzkocer
added a commit
that referenced
this pull request
Sep 26, 2025
* Unify categories and tags endpoints into terms endpoint Consolidate separate categories and tags REST API endpoints into a unified terms endpoint to reduce code duplication and improve maintainability. The unified approach uses TermEndpointType to distinguish between different taxonomy types while sharing common functionality. Changes: - Replace CategoryId and TagId with unified TermId type - Consolidate CategoryCreateParams/TagCreateParams into TermCreateParams - Consolidate CategoryListParams/TagListParams into TermListParams - Consolidate CategoryUpdateParams/TagUpdateParams into TermUpdateParams - Add TermEndpointType enum to specify taxonomy type (Categories/Tags) - Update API client to use unified terms() endpoint methods - Update all integration tests to use new unified terms API - Update Swift and Kotlin bindings to export unified types - Remove legacy categories_endpoint and tags_endpoint modules * Complete Swift implementation for unified terms endpoint Update Swift wrapper to use the new unified terms endpoint with TermEndpointType parameter, following the same pattern as the posts unification in PR #915. This enables custom taxonomy support while maintaining backward compatibility for existing categories and tags functionality. Changes: - Update WordPressAPI.swift to use unified terms endpoint - Update Pagination.swift with TypedPaginationAwareExecutor for terms - Add AnyTermWithEditContext support in ListViewData - Fix CancellationTests to use new posts API signature
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Consolidates the separate
/posts
and/pages
endpoints into a unified/posts
endpoint that accepts aPostEndpointType
parameter, enabling support for custom post types while maintaining backward compatibility for existing functionality.Breaking Changes
PostEndpointType
parameter (.posts
,.pages
, or.custom(String)
)SparsePost
/SparsePage
→SparseAnyPost
,PostWithEditContext
/PageWithEditContext
→AnyPostWithEditContext
Key Changes
SparseAnyPost
type with#[WpContextualOption]
for page-specific fieldsMigration