WP_REST_URL_Details_Controller
- Since
- 5.9.0
- Source
wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php:18
Controller which provides REST endpoint for retrieving information from a remote site's HTML response.
Compatibility
- WordPress
- since 5.9.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Hooks and filters fired · 3
Every hook that fires from inside WP_REST_URL_Details_Controller, in the order it appears in the class, grouped by the method that fires it.
WP_REST_URL_Details_Controller::parse_url_details()
- apply_filters( rest_prepare_url_details )filter line 187
Methods · 17
- __construct()Constructs the controller.
- register_routes()Registers the necessary REST API routes.
- get_item_schema()Retrieves the item's schema, conforming to JSON Schema.
- parse_url_details()Retrieves the contents of the title tag from the HTML response.
- permissions_check()Checks whether a given request has permission to read remote URLs.
- get_remote_url()Retrieves the document title from a remote URL.
- get_title()Parses the title tag contents from the provided HTML.
- get_icon()Parses the site icon from the provided HTML.
- get_description()Parses the meta description from the provided HTML.
- get_image()Parses the Open Graph (OG) Image from the provided HTML.
- prepare_metadata_for_output()Prepares the metadata by: - stripping all HTML tags and tag entities.
- build_cache_key_for_url()Utility function to build cache key for a given URL.
- get_cache()Utility function to retrieve a value from the cache at a given key.
- set_cache()Utility function to cache a given data set at a given cache key.
- get_document_head()Retrieves the head element section.
- get_meta_with_content_elements()Gets all the meta tag elements that have a 'content' attribute.
- get_metadata_from_meta_element()Gets the metadata from a target meta element.
Changelog
Introduced in 5.9.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.