Tag Info

New answers tagged


The latest versions of WP have really improved the filterability of caption arguments, so I think this new answer will have the smallest footprint and safest operation. What we need to do is directly filter $atts['caption'] during shortcode_atts() for the [caption] shortcode. We can do this with the shortcode_atts_caption filter which only affects the ...


Did a bit more digging and it appears to have been a conflict in my theme: add_filter( 'post_thumbnail_html', 'remove_width_attribute', 10 ); add_filter( 'image_send_to_editor', 'remove_width_attribute', 10 ); function remove_width_attribute( $html ) { $html = preg_replace( '/(width|height)="\d*"\s/', "", $html ); return $html; }

Top 50 recent answers are included