Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

img_shortcode

// Add Shortcode
function img_shortcode( $atts , $content = null ) {

	// Attributes
	extract( shortcode_atts(
		array(
			'width' => '',
			'height' => '',
		), $atts )
	);

	// Code
return '<img src="' . $content . '" width="' . $width . '" height="' . $height . '">';

}
add_shortcode( 'img', 'img_shortcode' );