Embeds: In get_oembed_endpoint_url(), avoid inadvertent stomping of the $format parameter passed to oembed_endpoint_url filter.

Props danhgilmore.
Fixes #37751.

git-svn-id: https://develop.svn.wordpress.org/trunk@38321 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2016-08-23 00:04:46 +00:00
parent f2a91f6157
commit 03e402b2ec

View File

@ -380,14 +380,10 @@ function get_post_embed_url( $post = null ) {
function get_oembed_endpoint_url( $permalink = '', $format = 'json' ) {
$url = rest_url( 'oembed/1.0/embed' );
if ( 'json' === $format ) {
$format = false;
}
if ( '' !== $permalink ) {
$url = add_query_arg( array(
'url' => urlencode( $permalink ),
'format' => $format,
'format' => ( 'json' !== $format ) ? $format : false,
), $url );
}