PHP Класс WDS_WP_REST_API\Discover

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$args
$legacy
$root
$site WDS_WP_REST_API\Discover\Site Site object
$uri

Открытые методы

Метод Описание
__construct ( string $uri, $args = [], boolean $legacy = false ) : Site | null Discover the WordPress API from a URI.
request ( string $uri, string $request_type = 'get' ) : mixed Make a request using the WP http API
site ( ) : Site Get the Site object

Защищенные методы

Метод Описание
discover_api_root ( ) : string | null Discover the API root from an address.
get_index_information ( ) : Site Get the index information from a site.
parse_link_header ( string $link ) : array Parse a Link header into attributes.

Описание методов

__construct() публичный Метод

Discover the WordPress API from a URI.
С версии: 0.2.1
public __construct ( string $uri, $args = [], boolean $legacy = false ) : Site | null
$uri string URI to start the search from.
$legacy boolean Should we check for the legacy API too?
Результат WDS_WP_REST_API\Discover\Site | null Site data if available, null if not a WP site.

discover_api_root() защищенный Метод

Discover the API root from an address.
С версии: 0.2.1
protected discover_api_root ( ) : string | null
Результат string | null API root URL if found, null if no API is available.

get_index_information() защищенный Метод

Get the index information from a site.
С версии: 0.2.1
protected get_index_information ( ) : Site
Результат WDS_WP_REST_API\Discover\Site Data from the index for the site.

request() публичный Метод

Make a request using the WP http API
С версии: 0.2.2
public request ( string $uri, string $request_type = 'get' ) : mixed
$uri string URI to make request to
$request_type string Type of request. Defaults to 'get'
Результат mixed Return of the request.

site() публичный Метод

Get the Site object
public site ( ) : Site
Результат WDS_WP_REST_API\Discover\Site

Описание свойств

$args защищенное свойство

protected $args

$legacy защищенное свойство

protected $legacy

$root защищенное свойство

protected $root

$site защищенное свойство

Site object
protected Site,WDS_WP_REST_API\Discover $site
Результат WDS_WP_REST_API\Discover\Site

$uri защищенное свойство

protected $uri