Skip to content

Instantly share code, notes, and snippets.

@ville6000
Last active November 10, 2015 08:04
Show Gist options
  • Save ville6000/a674647dfafc23ae4ea3 to your computer and use it in GitHub Desktop.
Save ville6000/a674647dfafc23ae4ea3 to your computer and use it in GitHub Desktop.
Remove extra 10 pixel space from WordPress caption
<?php
function my_theme_fix_extra_caption_padding( $atts ) {
if ( ! empty( $atts['width'] ) ) {
$atts['width'] -= 10;
}
return $atts;
}
add_filter( 'shortcode_atts_caption', 'my_theme_fix_extra_caption_padding' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment