@wpthemes777.com Thanks but I found the solution in media.php inside the includes folder.
Changed this:
$class = 'align' . esc_attr($align) .' size-' . esc_attr($size) . ' wp-image-' . $id;
to this:
$class = 'align' . esc_attr($align) . ' ' . esc_attr($size) . ' wp-image-' . $id;
Yes, it’s always possible to edit the source codes, but it’s not recommended due to upgrades. Actually you should never touch the WordPress source files.
A better approach in this case will be using jQuery javascript
http://stackoverflow.com/questions/3452778/jquery-change-class-name
loading the *.js file via wp_enqueue_script
http://codex.wordpress.org/Function_Reference/wp_enqueue_script
in your themes functions.php file, so you don’t have to worry about upgrades.
Great point. I completely forgot about that. I was also thinking to use a filter to remove the align class and edit size-
I tried the following code but nothing changed. Not sure how to go about this.
add_filter( 'post_thumbnail_html', 'remove_image_classes', 10 );
add_filter( 'image_send_to_editor', 'remove_image_classes', 10 );
function remove_image_classes( $html ) {
$html = preg_replace( '/(size-|alignnone)/', "", $html );
return $html;
}