WordPress filter hook · part of WordPress core

oembed_result

A WordPress core filter that 9 plugins also fire themselves, running on 13M+ sites between them.

“This filter is documented in wp-includes/class-oembed.php”

How to use oembed_result

It's a filter: your callback receives the value and 2 more arguments, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'oembed_result', function( $iframe_html, $video_url, $frame_attributes ) {
	// Change $iframe_html here.
	return $iframe_html;
}, 10, 3 );

Argument names come from Elementor Agent Ready Website Builder's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

9 plugins that fire oembed_result

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Elementor Agent Ready Website Builder icon Elementor Agent Ready Website Builder10+ million installs apply_filters( 'oembed_result', $iframe_html, $video_url, $frame_attributes ) includes/embed.php:256
  2. Jetpack icon Jetpack3+ million installs apply_filters( 'oembed_result', $oembed->data2html( $data, $lookup ), $lookup, $args ) jetpack_vendor/automattic/jetpack-comments/src/editor/class-embeds.php:200
  3. ActivityPub icon ActivityPub6,000+ installs apply_filters( 'oembed_result', $data->html, $url, $args ) includes/class-embed.php:296
  4. Embed Extended icon Embed Extended400+ installs apply_filters( 'oembed_result', $wp_oembed->data2html($data, $url), $url, $args ) embed-extended.php:220
  5. oEmbed External Video icon oEmbed External Video200+ installs apply_filters( 'oembed_result', $embed, $url, $attr ) oEmbed-external-video.php:47
  6. Rajce embed icon Rajce embed30+ installs apply_filters( 'oembed_result', $embed, $url, '' ) rajce-embed.php:241
  7. Media embed for Archive.org icon Media embed for Archive.org10+ installs apply_filters( 'oembed_result', $data->html, $url, $args ) includes/class-editor.php:88
  8. Qazana Layout builder for WordPress icon Qazana Layout builder for WordPress10+ installs apply_filters( 'oembed_result', $iframe_html, $video_url, $frame_attributes ) includes/common/embed.php:100
  9. Easy Dexter Lightbox icon Easy Dexter LightboxFewer than 10 installs apply_filters( 'oembed_result', $embed, $url ) plugin.php:329

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.