unset( $args['url'
] );
// Copy maxwidth/maxheight to width/height since WP_oEmbed::fetch() uses these arg names.
if ( isset( $args['maxwidth'
] ) ) { $args['width'
] =
$args['maxwidth'
];
} if ( isset( $args['maxheight'
] ) ) { $args['height'
] =
$args['maxheight'
];
} // Short-circuit process for URLs belonging to the current site.
$data =
get_oembed_response_data_for_url( $url,
$args );
if ( $data ) { return $data;
} $data =
_wp_oembed_get_object()->
get_data( $url,
$args );
if ( false ===
$data ) { // Try using a classic embed, instead.
/* @var WP_Embed $wp_embed */
$html =
$wp_embed->
get_embed_handler_html( $args,
$url );