Summery Summery

Retrieves the oEmbed endpoint URL for a given permalink.

Syntax Syntax

get_oembed_endpoint_url( string $permalink = '', string $format = 'json' )

Description Description

Pass an empty string as the first argument to get the endpoint base URL.

Parameters Parameters


(string) (Optional) The permalink used for the url query arg.

Default value: ''


(string) (Optional) The requested response format.

Default value: 'json'

Return Return

(string) The oEmbed endpoint URL.

Source Source

File: wp-includes/embed.php

	if ( '' !== $permalink ) {
		$url = add_query_arg(
				'url'    => urlencode( $permalink ),
				'format' => ( 'json' !== $format ) ? $format : false,

	 * Filters the oEmbed endpoint URL.
	 * @since 4.4.0
	 * @param string $url       The URL to the oEmbed endpoint.
	 * @param string $permalink The permalink used for the `url` query arg.
	 * @param string $format    The requested response format.
	return apply_filters( 'oembed_endpoint_url', $url, $permalink, $format );

 * Retrieves the embed code for a specific post.


Changelog Changelog

Version Description
4.4.0 Introduced.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.