Filter hook 'embed_oembed_html'

in WP Core File wp-includes/class-wp-embed.php at line 374

View Source

embed_oembed_html

Filter Hook
Description
Filters whether to inspect the given URL for discoverable link tags.

Hook Information

File Location wp-includes/class-wp-embed.php View on GitHub
Hook Type Filter
Line Number 374

Hook Parameters

Type Name Description
bool $enable Whether to enable `` tag discovery. Default true.

Usage Examples

Basic Usage
<?php
// Hook into embed_oembed_html
add_filter('embed_oembed_html', 'my_custom_filter', 10, 1);

function my_custom_filter($enable) {
    // Your custom filtering logic here
    return $enable;
}

Source Code Context

wp-includes/class-wp-embed.php:374 - How this hook is used in WordPress core
<?php
 369  		}
 370  
 371  		// If there was a result, return it.
 372  		if ( $html ) {
 373  			/** This filter is documented in wp-includes/class-wp-embed.php */
 374  			return apply_filters( 'embed_oembed_html', $html, $url, $attr, $post_id );
 375  		}
 376  
 377  		// Still unknown.
 378  		return $this->maybe_make_link( $url );
 379  	}

PHP Documentation

<?php
/**
		 * Filters whether to inspect the given URL for discoverable link tags.
		 *
		 * @since 2.9.0
		 * @since 4.4.0 The default value changed to true.
		 *
		 * @see WP_oEmbed::discover()
		 *
		 * @param bool $enable Whether to enable `<link>` tag discovery. Default true.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/class-wp-embed.php
Related Hooks

Related hooks will be displayed here in future updates.