We'll create fresh WordPress site with CC-IMG-Shortcode installed. You have 20 minutes to test the plugin after that site we'll be deleted.
This plugin adds the [img] shortcode which replaces the <img> html tag. It’s also enables adding new media to post/page via the ‘Add media’ button by automatically inserting the formatted shortcode code to the editor.
You can simply add the [img] shortcode with a media ID to display:
[img 123 /]
or a fully formatted [img] shortcode:
[img 123 align="center" size="full" caption="Sample text" title="Sample text" desc="Sample text" alt="Sample text" url="http://example.com/" /]
It’s supports srcset and sizes parameters.
You can use your own html template file for displaying the img tag by using filter:
add_filter( 'Clearcode\IMG_Shortcode\template', function() { return '/themes/clearcode.cc/templates/img.php'; } );