wp_embed_handler_youtube
Filter HookDescription
Filters the YouTube embed output.Hook Information
File Location |
wp-includes/embed.php
View on GitHub
|
Hook Type | Filter |
Line Number | 258 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$embed
|
YouTube embed output. |
array
|
$attr
|
An array of embed attributes. |
string
|
$url
|
The original URL that was matched by the regex. |
array
|
$rawattr
|
The original unmodified attributes. |
Usage Examples
Basic Usage
<?php
// Hook into wp_embed_handler_youtube
add_filter('wp_embed_handler_youtube', 'my_custom_filter', 10, 4);
function my_custom_filter($embed, $attr, $url, $rawattr) {
// Your custom filtering logic here
return $embed;
}
Source Code Context
wp-includes/embed.php:258
- How this hook is used in WordPress core
<?php
253 * @param string $embed YouTube embed output.
254 * @param array $attr An array of embed attributes.
255 * @param string $url The original URL that was matched by the regex.
256 * @param array $rawattr The original unmodified attributes.
257 */
258 return apply_filters( 'wp_embed_handler_youtube', $embed, $attr, $url, $rawattr );
259 }
260
261 /**
262 * Audio embed handler callback.
263 *
PHP Documentation
<?php
/**
* Filters the YouTube embed output.
*
* @since 4.0.0
*
* @see wp_embed_handler_youtube()
*
* @param string $embed YouTube embed output.
* @param array $attr An array of embed attributes.
* @param string $url The original URL that was matched by the regex.
* @param array $rawattr The original unmodified attributes.
*/
Quick Info
- Hook Type: Filter
- Parameters: 4
- File: wp-includes/embed.php
Related Hooks
Related hooks will be displayed here in future updates.