Last active
January 21, 2016 00:24
-
-
Save dougwollison/b073bd2a733beecb6ede to your computer and use it in GitHub Desktop.
Patch unsupported shortcode tags for WordPress 4.4
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
add_filter('the_content', function($content){ | |
global $shortcode_tags; | |
$tagnames = array_keys($shortcode_tags); | |
$tagregexp = join( '|', array_map('preg_quote', $tagnames) ); | |
// Convert [tagname="mainproperty" to [tagname "mainproperty" (still accessible by $atts[0]) | |
$content = preg_replace("/\\[($tagregexp)=/s", '[$1 ', $content); | |
return $content; | |
}, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment