/**
* Callback for the embed API endpoint.
*
* Returns the JSON object for the post.
*
* @since 4.4.0
*
* @param WP_REST_Request $request Full data about the request.
* @return array|WP_Error oEmbed response data or WP_Error on failure.
*/
public function get_item( $request ) { $post_id =
url_to_postid( $request['url'
] );
/**
* Filters the determined post ID.
*
* @since 4.4.0
*
* @param int $post_id The post ID.
* @param string $url The requested URL.
*/
$post_id =
apply_filters( 'oembed_request_post_id',
$post_id,
$request['url'
] );