WPDev.one
Core Class

WP_REST_URL_Details_Controller

class WP_REST_URL_Details_Controller // Constructor: function Object() { [native code] }

Controller which provides REST endpoint for retrieving information

Methods 17 methods

Method / Return Description
__construct()
void

Constructs the controller.

register_routes()
void

Registers the necessary REST API routes.

get_item_schema()
array

Retrieves the item's schema, conforming to JSON Schema.

parse_url_details()
(WP_REST_Response

Retrieves the contents of the title tag from the HTML response.

Parameters: $request: mixed
permissions_check()
(true

Checks whether a given request has permission to read remote URLs.

get_remote_url()
(string

Retrieves the document title from a remote URL.

Parameters: $url: mixed
get_title()
string

Parses the title tag contents from the provided HTML.

Parameters: $html: mixed
get_icon()
string

Parses the site icon from the provided HTML.

Parameters: $html: mixed, $url: mixed
get_description()
string

Parses the meta description from the provided HTML.

Parameters: $meta_elements: mixed
get_image()
string

Parses the Open Graph (OG) Image from the provided HTML.

Parameters: $meta_elements: mixed, $url: mixed
prepare_metadata_for_output()
string

Prepares the metadata by:

Parameters: $metadata: mixed
build_cache_key_for_url()
string

Utility function to build cache key for a given URL.

Parameters: $url: mixed
get_cache()
mixed

Utility function to retrieve a value from the cache at a given key.

Parameters: $key: mixed
set_cache()
bool

Utility function to cache a given data set at a given cache key.

Parameters: $key: mixed, $data: mixed
get_document_head()
string

Retrieves the head element section.

Parameters: $html: mixed
get_meta_with_content_elements()
array

Gets all the meta tag elements that have a 'content' attribute.

Parameters: $html: mixed
get_metadata_from_meta_element()
string

Gets the metadata from a target meta element.

Parameters: $meta_elements: mixed, $attr: mixed, $attr_value: mixed

Class Information

Since Version
5.9.0
Source File
wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php
Advertisement