I need to create an image widget which is similar to the wordpress media image widget, defined in the wordpress core in wp-includes/widgets/class-wp-widget-media-image.php
. I only need a couple minor differences:
- Remove the inline style which is hard-coded into the
$image_attributes
array as'style' => 'max-width: 100%; height: auto;',
- No title should appear on the front end even if one is entered on the backend.
I searched for filter hooks that would allow me to set these widget properties but found nothing useful. I even tried copying the source code for the WordPress image widget and modifying to create the desired widget. However, I was not able to change the frontend title output. Can anyone describe the correct way to go about creating this widget?