Created
February 6, 2019 08:39
-
-
Save mizner/719635d726d14746f6425fab6a2de0c3 to your computer and use it in GitHub Desktop.
Filter WordPress Gutenberg Block Output
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) { | |
// Remove the block/timed-block from the rendered content. | |
if ('core/paragraph' === $block['blockName']) { | |
$block_content = "<div class='wp-block' data-blockType='{$block['blockName']}'>{$block_content}</div>"; | |
} | |
return $block_content; | |
}, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment