PHP Class WDS_WP_REST_API\Discover

Afficher le fichier Open project: webdevstudios/wds-wp-rest-api-connect Class Usage Examples

Protected Properties

Свойство Type Description
$args
$legacy
$root
$site WDS_WP_REST_API\Discover\Site Site object
$uri

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
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.

Method Details

__construct() public méthode

Discover the WordPress API from a URI.
Since: 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?
Résultat WDS_WP_REST_API\Discover\Site | null Site data if available, null if not a WP site.

discover_api_root() protected méthode

Discover the API root from an address.
Since: 0.2.1
protected discover_api_root ( ) : string | null
Résultat string | null API root URL if found, null if no API is available.

get_index_information() protected méthode

Get the index information from a site.
Since: 0.2.1
protected get_index_information ( ) : Site
Résultat WDS_WP_REST_API\Discover\Site Data from the index for the site.

request() public méthode

Make a request using the WP http API
Since: 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'
Résultat mixed Return of the request.

site() public méthode

Get the Site object
public site ( ) : Site
Résultat WDS_WP_REST_API\Discover\Site

Property Details

$args protected_oe property

protected $args

$legacy protected_oe property

protected $legacy

$root protected_oe property

protected $root

$site protected_oe property

Site object
protected Site,WDS_WP_REST_API\Discover $site
Résultat WDS_WP_REST_API\Discover\Site

$uri protected_oe property

protected $uri