Filter hook 'embed_handler_html'

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

View Source

embed_handler_html

Filter Hook
Description
Filters the returned embed HTML.

Hook Information

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

Hook Parameters

Type Name Description
string $return The HTML result of the shortcode.
string $url The embed URL.
array $attr An array of shortcode attributes.

Usage Examples

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

function my_custom_filter($return, $url, $attr) {
    // Your custom filtering logic here
    return $return;
}

Source Code Context

wp-includes/class-wp-embed.php:170 - How this hook is used in WordPress core
<?php
 165  						 *
 166  						 * @param string $return The HTML result of the shortcode.
 167  						 * @param string $url    The embed URL.
 168  						 * @param array  $attr   An array of shortcode attributes.
 169  						 */
 170  						return apply_filters( 'embed_handler_html', $return, $url, $attr );
 171  					}
 172  				}
 173  			}
 174  		}
 175  

PHP Documentation

<?php
/**
						 * Filters the returned embed HTML.
						 *
						 * @since 2.9.0
						 *
						 * @see WP_Embed::shortcode()
						 *
						 * @param string $return The HTML result of the shortcode.
						 * @param string $url    The embed URL.
						 * @param array  $attr   An array of shortcode attributes.
						 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/class-wp-embed.php
Related Hooks

Related hooks will be displayed here in future updates.