oembed_result
Filter HookDescription
Filters the HTML returned by the oEmbed provider.Hook Information
File Location |
wp-includes/class-wp-oembed.php
View on GitHub
|
Hook Type | Filter |
Line Number | 430 |
Hook Parameters
Type | Name | Description |
---|---|---|
string|false
|
$data
|
The returned oEmbed HTML (false if unsafe). |
string
|
$url
|
URL of the content to be embedded. |
string|array
|
$args
|
Optional. Additional arguments for retrieving embed HTML. See wp_oembed_get() for accepted arguments. Default empty. |
Usage Examples
Basic Usage
<?php
// Hook into oembed_result
add_filter('oembed_result', 'my_custom_filter', 10, 3);
function my_custom_filter($data, $url, $args) {
// Your custom filtering logic here
return $data;
}
Source Code Context
wp-includes/class-wp-oembed.php:430
- How this hook is used in WordPress core
<?php
425 * @param string|false $data The returned oEmbed HTML (false if unsafe).
426 * @param string $url URL of the content to be embedded.
427 * @param string|array $args Optional. Additional arguments for retrieving embed HTML.
428 * See wp_oembed_get() for accepted arguments. Default empty.
429 */
430 return apply_filters( 'oembed_result', $this->data2html( $data, $url ), $url, $args );
431 }
432
433 /**
434 * Attempts to discover link tags at the given URL for an oEmbed provider.
435 *
PHP Documentation
<?php
/**
* Filters the HTML returned by the oEmbed provider.
*
* @since 2.9.0
*
* @param string|false $data The returned oEmbed HTML (false if unsafe).
* @param string $url URL of the content to be embedded.
* @param string|array $args Optional. Additional arguments for retrieving embed HTML.
* See wp_oembed_get() for accepted arguments. Default empty.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/class-wp-oembed.php
Related Hooks
Related hooks will be displayed here in future updates.