Make WordPress Core

Changeset 51973

Timestamp:
11/02/2021 12:46:01 PM (3 years ago)
Author:
hellofromTonya
Message:

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.

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api.php

    r51964 r51973  
    337337    $site_health = WP_Site_Health::get_instance();
    338338    $controller  = new WP_REST_Site_Health_Controller( $site_health );
     339
     340
     341
     342
    339343    $controller->register_routes();
    340344}
  • trunk/src/wp-settings.php

    r51056 r51973  
    277277require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-widgets-controller.php';
    278278require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-templates-controller.php';
     279
    279280require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-meta-fields.php';
    280281require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-comment-meta-fields.php';
  • trunk/tests/qunit/fixtures/wp-api-generated.js

    r51964 r51973  
    1616        "oembed/1.0",
    1717        "wp/v2",
    18         "wp-site-health/v1"
     18        "wp-site-health/v1",
     19        "wp-block-editor/v1"
    1920    ],
    2021    "authentication": [],
     
    75397540                ]
    75407541            }
     7542
     7543
     7544
     7545
     7546
     7547
     7548
     7549
     7550
     7551
     7552
     7553
     7554
     7555
     7556
     7557
     7558
     7559
     7560
     7561
     7562
     7563
     7564
     7565
     7566
     7567
     7568
     7569
     7570
     7571
     7572
     7573
     7574
     7575
     7576
     7577
     7578
     7579
     7580
     7581
     7582
     7583
     7584
     7585
     7586
     7587
     7588
     7589
     7590
     7591
     7592
     7593
     7594
     7595
     7596
     7597
     7598
     7599
    75417600        }
    75427601    },
Note: See TracChangeset for help on using the changeset viewer.