get_oembed_response_data_for_url example

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 );

            

function wp_filter_pre_oembed_result( $result$url$args ) {
    $data = get_oembed_response_data_for_url( $url$args );

    if ( $data ) {
        return _wp_oembed_get_object()->data2html( $data$url );
    }

    return $result;
}
Home | Imprint | This part of the site doesn't use cookies.