Class: WP_oEmbed_Controller

oEmbed API endpoint controller.

Registers the API route and delivers the response data. The output format (XML or JSON) is handled by the REST API.

Properties



Methods

WP_oEmbed_Controller:: get_item( WP_REST_Request $request )

Callback for the embed API endpoint. Since 4.4.0.

Returns the JSON object for the post.

Arguments

Name Type(s) Default Value Description
$request WP_REST_Request

Full data about the request.

Returns

WP_Error | array

oEmbed response data or WP_Error on failure.


WP_oEmbed_Controller:: get_proxy_item( WP_REST_Request $request )

Callback for the proxy API endpoint. Since 4.8.0.

Returns the JSON object for the proxied item.

Arguments

Name Type(s) Default Value Description
$request WP_REST_Request

Full data about the request.

Returns

object | WP_Error

oEmbed response data or WP_Error on failure.


WP_oEmbed_Controller:: get_proxy_item_permissions_check( )

Checks if current user can make a proxy oEmbed request. Since 4.8.0.

Returns

true | WP_Error

True if the request has read access, WP_Error object otherwise.


WP_oEmbed_Controller:: register_routes( )

Register the oEmbed REST API route. Since 4.4.0.


WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.