Last active
August 7, 2020 17:19
-
-
Save mihdan/36f7e9a4634f4b3ea855e64d0d69ca23 to your computer and use it in GitHub Desktop.
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 | |
add_filter( | |
'render_block', | |
function ( $block_content, $block ) { | |
if ( 'core/image' === $block['blockName'] ) { | |
$block_content = str_replace( | |
array( '<figure ', '</figure>' ), | |
array( '<p ', '</p>' ), | |
$block_content | |
); | |
} | |
return $block_content; | |
}, | |
10, | |
2 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment