Last active
November 10, 2015 08:04
-
-
Save ville6000/a674647dfafc23ae4ea3 to your computer and use it in GitHub Desktop.
Remove extra 10 pixel space from WordPress caption
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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