Interface: WpQueryParams
Defined in: src/types/index.ts:1501
Common query parameters for WordPress REST API list endpoints.
Indexable
[
key:string]:unknown
Custom query params.
Properties
_embed?
optional_embed?:string|boolean
Defined in: src/types/index.ts:1550
Embed related resources in the response (author, featured media, terms, replies).
Accepts true to embed all, or comma-separated resource names.
Example
useWpGetPosts({ _embed: true }); // embed all
useWpGetPosts({ _embed: "author,wp:featuredmedia" }); // embed specific
_fields?
optional_fields?:string
Defined in: src/types/index.ts:1539
Limit response fields to reduce payload size. Use comma-separated field names: "id,title,link" or nested: "id,title.rendered,acf.custom_field". Reduces response size by 60-80% — essential for list views.
Example
useWpGetPosts({ _fields: "id,title,link,slug,date" });
useWpGetPosts({ _fields: "id,title.rendered,acf.hero_image,acf.subtitle" }); // with ACF
author?
optionalauthor?:number|number[]
Defined in: src/types/index.ts:1523
Filter by author.
categories?
optionalcategories?:number|number[]
Defined in: src/types/index.ts:1525
Filter by categories.
exclude?
optionalexclude?:number[]
Defined in: src/types/index.ts:1517
Exclude specific IDs.
include?
optionalinclude?:number[]
Defined in: src/types/index.ts:1515
Include specific IDs.
offset?
optionaloffset?:number
Defined in: src/types/index.ts:1513
Offset for pagination.
order?
optionalorder?:"asc"|"desc"
Defined in: src/types/index.ts:1509
Sort order.
orderby?
optionalorderby?:string
Defined in: src/types/index.ts:1511
Order by field.
page?
optionalpage?:number
Defined in: src/types/index.ts:1503
Current page (default: 1).
per_page?
optionalper_page?:number
Defined in: src/types/index.ts:1505
Items per page (default: 10, max: 100).
search?
optionalsearch?:string
Defined in: src/types/index.ts:1507
Search term.
slug?
optionalslug?:string
Defined in: src/types/index.ts:1519
Filter by slug.
status?
optionalstatus?:string|string[]
Defined in: src/types/index.ts:1521
Filter by status.
tags?
optionaltags?:number|number[]
Defined in: src/types/index.ts:1527
Filter by tags.