You can try this:
add_filter( 'media_send_to_editor', 'remove_width_height_attribute', 10 );
function remove_width_height_attribute( $html ) {
$html = preg_replace( '/(width|height)="\d*"\s/', "", $html );
return $html;
}
You can try this:
add_filter( 'media_send_to_editor', 'remove_width_height_attribute', 10 );
function remove_width_height_attribute( $html ) {
$html = preg_replace( '/(width|height)="\d*"\s/', "", $html );
return $html;
}