Skip to content

Commit 1822d98

Browse files
REST API: Add URL Details endpoint.
Adds a new REST API endpoint (`/wp-block-editor/v1/url-details`) for retrieving information from an external URL. Information retrieved: * Title: content of the `<title>` element * Icon: favicon image link * Description: content of the `description` or `og:description` meta element * Image: OG image link This endpoint is used by the block editor for link previews. Props get_dave, aduth, andraganescu, beaulebens, hellofromTonya, kevin940726, mamaduka, marekhrabe, mnelson4, noisysocks, obenland, ocean90, retrofox, shaunandrews, spacedmonkey, swissspidy, timothyblynjacobs, xknown, youknowriad. Fixes #54358. git-svn-id: https://develop.svn.wordpress.org/trunk@51973 602fd350-edb4-49c9-b593-d223f7449a82
1 parent b45c85a commit 1822d98

5 files changed

Lines changed: 1887 additions & 1 deletion

File tree

src/wp-includes/rest-api.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,10 @@ function create_initial_rest_routes() {
337337
$site_health = WP_Site_Health::get_instance();
338338
$controller = new WP_REST_Site_Health_Controller( $site_health );
339339
$controller->register_routes();
340+
341+
// URL Details.
342+
$controller = new WP_REST_URL_Details_Controller();
343+
$controller->register_routes();
340344
}
341345

342346
/**

0 commit comments

Comments
 (0)