This plugin replaces the default Media-Caption markup which uses a style
attribute and fix width
values with a more flexible one.
You'll need to adapt your themes or childthemes css. So this plugin is not just »plug'n'play«.
.wp-caption-wrapper.aligncenter {
text-align: center;
}
.wp-caption.aligncenter {
display: inline-block;
}
/* and of course… */
img {
max-width: 100%;
height: auto;
}
Indeed, one could handle this issue with exactly one function. So why this effort? Because I can. Seriously: first of all this somewhat a proof-of-concept and one example on a testable MVC pattern in a WordPress plugin. Critical reviews are welcome!