Filter hook 'embed_html'

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

View Source

embed_html

Filter Hook
Description
Filters the embed HTML output for a given post.

Hook Information

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

Hook Parameters

Type Name Description
string $output The default iframe tag to display embedded content.
WP_Post $post Current post object.
int $width Width of the response.
int $height Height of the response.

Usage Examples

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

function my_custom_filter($output, $post, $width, $height) {
    // Your custom filtering logic here
    return $output;
}

Source Code Context

wp-includes/embed.php:535 - How this hook is used in WordPress core
<?php
 530  	 * @param string  $output The default iframe tag to display embedded content.
 531  	 * @param WP_Post $post   Current post object.
 532  	 * @param int     $width  Width of the response.
 533  	 * @param int     $height Height of the response.
 534  	 */
 535  	return apply_filters( 'embed_html', $output, $post, $width, $height );
 536  }
 537  
 538  /**
 539   * Retrieves the oEmbed response data for a given post.
 540   *

PHP Documentation

<?php
/**
	 * Filters the embed HTML output for a given post.
	 *
	 * @since 4.4.0
	 *
	 * @param string  $output The default iframe tag to display embedded content.
	 * @param WP_Post $post   Current post object.
	 * @param int     $width  Width of the response.
	 * @param int     $height Height of the response.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 4
  • File: wp-includes/embed.php
Related Hooks

Related hooks will be displayed here in future updates.