Skip to content

Instantly share code, notes, and snippets.

@jmdodd
Created November 29, 2011 08:38
Show Gist options
  • Save jmdodd/1404031 to your computer and use it in GitHub Desktop.
Save jmdodd/1404031 to your computer and use it in GitHub Desktop.
Unfilter links in captions in the WordPress Add Image dialogue
<?php
if ( ! function_exists( 'ucc_fix_image_add_caption_shortcode' ) ) {
function ucc_fix_image_add_caption_shortcode( $shcode, $html ) {
$shcode = str_replace( array( '&gt;', '&lt;', '&quot;', '&#039;' ),
array( '>', '<', '"', "'" ),
$shcode );
return( $shcode );
} }
add_filter( 'image_add_caption_shortcode', 'ucc_fix_image_add_caption_shortcode', 21, 2 );
/*
Copyright 2011 Jennifer M. Dodd (email: jmdodd@gmail.com)
Released under the GPLv2 (or later).
*/
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment