Skip to content

Instantly share code, notes, and snippets.

@mihdan
Last active August 7, 2020 17:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mihdan/36f7e9a4634f4b3ea855e64d0d69ca23 to your computer and use it in GitHub Desktop.
Save mihdan/36f7e9a4634f4b3ea855e64d0d69ca23 to your computer and use it in GitHub Desktop.
<?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