Skip to content

Instantly share code, notes, and snippets.

@cameronjonesweb
Created July 2, 2020 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cameronjonesweb/6c42f99253aba79d7c0b8cf7279593eb to your computer and use it in GitHub Desktop.
Save cameronjonesweb/6c42f99253aba79d7c0b8cf7279593eb to your computer and use it in GitHub Desktop.
<?php
function cameronjonesweb_wrap_classic_posts( $block_content, $block ) {
if ( is_null( $block['blockName'] ) && ! empty( trim( $block_content ) ) ) {
$output = '<div class="classic-block">';
$output .= $block_content;
$output .= '</div>';
$block_content = $output;
}
return $block_content;
}
add_filter( 'render_block', 'cameronjonesweb_wrap_classic_posts', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment