This page redirects to an external site: https://developer.wordpress.org/reference/hooks/embed_defaults/
Filters the default array of embed dimensions.
The width defaults to the content width as specified by the theme. If the theme does not specify a content width, then 500px is used. The default height is 1.5 times the width, or 1000px, whichever is smaller.
The 'embed_defaults' filter can be used to adjust either of these values.
<?php add_filter( 'embed_defaults', 'filter_function_name' ) ?>
Added to your child themes functions.php file, you can modify the default embed dimensions.
add_filter( 'embed_defaults', 'modify_embed_defaults' );
function modify_embed_defaults() {
return array(
'width' => 750,
'height' => 375
);
}
embed_defaults is located in wp-includes/media.php
Embeds: wp_oembed_add_provider(), wp_oembed_remove_provider(), wp_oembed_get(), wp_embed_defaults(), wp_embed_register_handler(), wp_embed_unregister_handler(), get_embedded_audio(), get_embedded_media(), get_embedded_video(), wp_embed_handler_audio(), wp_embed_handler_video()