Last active
August 10, 2018 04:12
-
-
Save tanftw/8cd7a32a2c5ff342746494473822f1fb 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
| $pattern1 = '/<img [^>]*class="[^"]*\balignnone\b[^"]*"[^>]*>/i'; | |
| $replacement = '<figure class="penci-wrapper-image">$0</figure>'; | |
| $content = '<div><img src="image.jpg" class="alignnone"></div>'; | |
| // run preg_replace() on the $content | |
| $content = preg_replace($pattern1, $replacement, $content); | |
| var_dump($content); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment