Created
May 24, 2019 19:40
-
-
Save pbrocks/8086031677e2eaa5f94093f9667855c4 to your computer and use it in GitHub Desktop.
WC Lancaster filter to show block type if you have WP_DEBUG turned on.
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', 'wplancpa_2019_show_block_type', 10, 2 ); | |
function wplancpa_2019_show_block_type( $block_content, $block ) { | |
if ( true === WP_DEBUG ) { | |
$block_content = "<h5 style=\"color:salmon\">{$block['blockName']}</h5><div class='wp-block' data-blockType='{$block['blockName']}'>{$block_content}</div>"; | |
} | |
return $block_content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment