WordPress API SDK

AbstractResource
in package
implements ResourceInterface

AbstractYes

Table of Contents

Interfaces

ResourceInterface

Properties

$baseUrl  : string
$client  : Client
$endpoint  : string

Methods

__construct()  : mixed
all()  : PaginatedResponse
Fetch all items with optional parameters
get()  : array<string, mixed>
Fetch a single item by ID
getBaseUrl()  : string
Get the base URL
getBySlug()  : array<string, mixed>
Fetch a single item by slug
getHttpClient()  : Client
Get the HTTP client
language()  : QueryBuilder
Filter by language (WPML support)
orderBy()  : QueryBuilder
Set order by
page()  : QueryBuilder
Set page number
perPage()  : QueryBuilder
Set results per page
query()  : PaginatedResponse
Custom query with parameters
search()  : QueryBuilder
Search within the resource
where()  : QueryBuilder
Start building a query

Properties

Methods

__construct()

public __construct(Client $client, string $baseUrl, string $endpoint) : mixed
Parameters
$client : Client
$baseUrl : string
$endpoint : string

getBaseUrl()

Get the base URL

public getBaseUrl() : string
Return values
string

getHttpClient()

Get the HTTP client

public getHttpClient() : Client
Return values
Client
On this page

Search results