embed_defaults
Filters the default array of embed dimensions.
Usage
add_filter( 'embed_defaults', 'wp_kama_embed_defaults_filter', 10, 2 );
/**
* Function for `embed_defaults` filter-hook.
*
* @param int[] $size Indexed array of the embed width and height in pixels.
* @param string $url The URL that should be embedded.
*
* @return int[]
*/
function wp_kama_embed_defaults_filter( $size, $url ){
// filter...
return $size;
}
- $size(int[])
Indexed array of the embed width and height in pixels.
-
0(int)
The embed width. - 1(int)
The embed height.
-
- $url(string)
- The URL that should be embedded.
Changelog
| Since 2.9.0 | Introduced. |
Where the hook is called
embed_defaults
wp-includes/embed.php 91
return apply_filters( 'embed_defaults', compact( 'width', 'height' ), $url );