Skip to content

Add dedicated clients for all missing WordPress REST API endpoints#425

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-missing-wordpress-rest-endpoints
Draft

Add dedicated clients for all missing WordPress REST API endpoints#425
Copilot wants to merge 2 commits intomainfrom
copilot/add-missing-wordpress-rest-endpoints

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

Implements the standard wp/v2 endpoints listed as gaps in docs/v3/endpoint-coverage.md. Adds 11 new top-level clients, 3 sub-resource helpers, 11 models, and 6 query builders.

New top-level clients on WordPressClient

Property Endpoint Operations
client.Search wp/v2/search query by term or SearchQueryBuilder
client.BlockTypes wp/v2/block-types read, GetByNameAsync("core","paragraph")
client.Blocks wp/v2/blocks full CRUD (reusable blocks)
client.Templates wp/v2/templates full CRUD, string compound IDs
client.TemplateParts wp/v2/template-parts full CRUD, string compound IDs
client.GlobalStyles wp/v2/global-styles/{id} GetByIdAsync, GetThemeStylesAsync, UpdateAsync
client.Navigation wp/v2/navigation full CRUD
client.Sidebars wp/v2/sidebars read + update (string IDs)
client.Widgets wp/v2/widgets full CRUD + GetBySidebarAsync (string IDs)
client.WidgetTypes wp/v2/widget-types read (string IDs)
client.UrlDetails wp/v2/url-details GetAsync(url) — requires auth

New sub-resource helpers

// Post autosaves (new)
var autosaves = await client.Posts.Autosaves(postId).GetAsync();

// Page revisions and autosaves (both new)
var revisions = await client.Pages.Revisions(pageId).GetAsync();
var autosaves  = await client.Pages.Autosaves(pageId).GetAsync();

Design notes

  • Templates, TemplateParts, Sidebars, Widgets, WidgetType all use string IDs (e.g. "twentytwentyfour//index", "sidebar-1"); they have custom CRUD implementations instead of CRUDOperation<T,Q> which assumes integer IDs.
  • Blocks and Navigation extend Base (integer ID) and reuse CRUDOperation<T,Q> normally.
  • GlobalStylesClient and UrlDetailsClient are named with a Client suffix to avoid clashing with the identically-named model classes.

New models

SearchResult, BlockType, Block, Template, TemplatePart, GlobalStyles, Navigation, Sidebar, Widget, WidgetType, UrlDetails (+OgImage)

New query builders

SearchQueryBuilder, BlocksQueryBuilder, TemplatesQueryBuilder, TemplatePartsQueryBuilder, NavigationQueryBuilder, WidgetsQueryBuilder

Docs + tests

  • docs/v3/endpoint-coverage.md and README.md updated to reflect the new coverage table and remaining gaps.
  • Self-hosted integration tests added for all new clients.

Copilot AI linked an issue Apr 7, 2026 that may be closed by this pull request
…Blocks, Templates, TemplateParts, GlobalStyles, Navigation, Sidebars, Widgets, WidgetTypes, UrlDetails; add page revisions and autosaves; update docs and add tests

Agent-Logs-Url: https://github.com/wp-net/WordPressPCL/sessions/94dfe725-c14e-470e-942a-fc5ce144e317

Co-authored-by: ThomasPe <4225039+ThomasPe@users.noreply.github.com>
Copilot AI changed the title [WIP] Add missing WordPress Rest endpoints Add dedicated clients for all missing WordPress REST API endpoints Apr 7, 2026
Copilot AI requested a review from ThomasPe April 7, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add missing WordPress Rest endpoints

2 participants