WordPress API SDK

Client
in package

Table of Contents

Properties

$baseUrl  : string
$httpClient  : Client

Methods

__construct()  : mixed
getBaseUrl()  : string
Get the base URL
getHttpClient()  : Client
Get the HTTP client
homepage()  : Homepage
Get homepage (front page)
menus()  : Menus
Get Menus resource
pages()  : Pages
Get Pages resource
posts()  : Posts
Get Posts resource
search()  : Search
Get Search resource
settings()  : Settings
Get WordPress settings

Properties

$baseUrl

private string $baseUrl

$httpClient

private Client $httpClient

Methods

__construct()

public __construct(string $baseUrl[, array<string, mixed> $options = [] ]) : mixed
Parameters
$baseUrl : string
$options : array<string, mixed> = []

getBaseUrl()

Get the base URL

public getBaseUrl() : string
Return values
string

getHttpClient()

Get the HTTP client

public getHttpClient() : Client
Return values
Client

homepage()

Get homepage (front page)

public homepage() : Homepage

Note: This is a convenience method. WordPress homepage can be:

  • A static page (check Settings > Reading in WordPress admin)
  • The blog posts list

For more control, query pages directly or check site settings.

Return values
Homepage

settings()

Get WordPress settings

public settings() : Settings

Note: Most settings require authentication to read. Some basic settings may be publicly available.

Return values
Settings
On this page

Search results