Created
December 21, 2018 11:06
-
-
Save campusboy87/8ddcfe6a67ce2f20d3e5691d26ea5756 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 filter_wp_caption_text( $content ) { | |
| return preg_replace( | |
| '/<p[^>]+class="wp-caption-text"[^>]*>(.+)(?=<\/p>)/s', | |
| '<div class="wp-caption-text">\1</div>', | |
| $content | |
| ); | |
| } | |
| add_filter( 'the_content', 'filter_wp_caption_text', 12 ); |
Author
campusboy87
commented
Dec 21, 2018

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment