mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-09 23:24:34 +00:00
Embeds: In get_post_embed_html(), move the optional $post argument after the required $width and $height.
Props swissspidy. Fixes #34523. git-svn-id: https://develop.svn.wordpress.org/trunk@35472 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -446,12 +446,12 @@ function get_oembed_endpoint_url( $permalink = '', $format = 'json' ) {
|
||||
*
|
||||
* @since 4.4.0
|
||||
*
|
||||
* @param int|WP_Post $post Optional. Post ID or object. Default is global `$post`.
|
||||
* @param int $width The width for the response.
|
||||
* @param int $height The height for the response.
|
||||
* @param int|WP_Post $post Optional. Post ID or object. Default is global `$post`.
|
||||
* @return string|false Embed code on success, false if post doesn't exist.
|
||||
*/
|
||||
function get_post_embed_html( $post = null, $width, $height ) {
|
||||
function get_post_embed_html( $width, $height, $post = null ) {
|
||||
$post = get_post( $post );
|
||||
|
||||
if ( ! $post ) {
|
||||
@@ -590,7 +590,7 @@ function get_oembed_response_data_rich( $data, $post, $width, $height ) {
|
||||
$data['width'] = absint( $width );
|
||||
$data['height'] = absint( $height );
|
||||
$data['type'] = 'rich';
|
||||
$data['html'] = get_post_embed_html( $post, $width, $height );
|
||||
$data['html'] = get_post_embed_html( $width, $height, $post );
|
||||
|
||||
// Add post thumbnail to response if available.
|
||||
$thumbnail_id = false;
|
||||
|
||||
Reference in New Issue
Block a user