Interface PageAPIs
- All Known Implementing Classes:
PageApiClientModule
This interface provides methods for creating, retrieving, updating, listing, trashing, and deleting
WpPage resources.
Operations support standard WordPress REST API features such as pagination, filtering, retrieval contexts, password-protected content, and partial querying.
Implementations are expected to communicate with the /wp-json/wp/v2/pages endpoint or compatible
APIs.
-
Method Summary
Modifier and TypeMethodDescriptioncreate(WpPageCreateUpdateRequest creationRequest) Creates a new page.create(WpPageCreateUpdateRequest creationRequest, Map<String, String> extraQueryParams) /**delete(long id) Permanently deletes a page by its unique identifier.Retrieves a page by its unique identifier using the given context.Retrieves a page by its unique identifier using the given context and optional password.list(WpPaginationQuery paginationQuery, WpPageQuery query) Retrieves a paginated list of pages using optional filtering and sorting criteria.trash(long id) Moves a page to the trash by its unique identifier.update(long id, WpPageCreateUpdateRequest updateRequest) Updates an existing page.
-
Method Details
-
create
Creates a new page.Creates a page in WordPress using the provided request payload.
- Parameters:
creationRequest- the page creation request; must not benull- Returns:
- the created
WpPage
-
create
/**Creates a new page.
- Parameters:
creationRequest- the page creation request; must not benullextraQueryParams- additional query parameters to include in the request.- Returns:
- the created
WpPage
-
delete
Permanently deletes a page by its unique identifier.- Parameters:
id- the ID of the page to delete- Returns:
- the page deletion response
-
get
Retrieves a page by its unique identifier using the given context.The context determines which fields are included in the response, for example
WpContext.VIEW,WpContext.EDIT, orWpContext.EMBED.- Parameters:
id- the ID of the page to retrievecontext- the retrieval context; may benull, in which caseWpContext.VIEWis used- Returns:
- the matching
WpPage
-
get
Retrieves a page by its unique identifier using the given context and optional password.The context determines which fields are included in the response, for example
WpContext.VIEW,WpContext.EDIT, orWpContext.EMBED.If the page is password protected, the provided password is used to access protected content. If the password is missing or incorrect, protected fields such as content or excerpt may be omitted or flagged as protected in the response.
- Parameters:
id- the ID of the page to retrievecontext- the retrieval context; may benull, in which caseWpContext.VIEWis usedpassword- the password for protected content; may benullwhen not required- Returns:
- the matching
WpPage
-
list
Retrieves a paginated list of pages using optional filtering and sorting criteria.The result set can be refined using
WpPageQuery, for example by filtering on search criteria, include or exclude lists, or sort order.- Parameters:
paginationQuery- the pagination settings, including page number and page size; must not benullquery- additional page query parameters; may benullwhen no extra filtering is needed- Returns:
- a paginated response containing
WpPageitems
-
trash
Moves a page to the trash by its unique identifier.- Parameters:
id- the ID of the page to trash- Returns:
- the trashed
WpPage
-
update
Updates an existing page.Updates a page in WordPress using the provided request payload.
- Parameters:
id- the ID of the page to updateupdateRequest- the page update request; must not benull- Returns:
- the updated
WpPage
-