Skip to content

Instantly share code, notes, and snippets.

@cstielper

cstielper/block.php

Last active May 20, 2021
Embed
What would you like to do?
Content not rendering after <InnerBlocks />
<?php
$allowed_blocks = array(
'core/heading',
);
$template = array(
array(
'core/heading',
array(
'level' => 2,
'textColor' => 'white',
'content' => __( 'Add your heading', 'text-domain' ),
),
),
);
echo '<InnerBlocks allowedBlocks="' . esc_attr( wp_json_encode( $allowed_blocks ) ) . '" template="' . esc_attr( wp_json_encode( $template ) ) . '" />';
if ( $is_preview ) :
?>
<div class="admin-notice">
<?php esc_html_e( 'Your signup form will appear below.', 'text-domain' ); ?>
</div>
<?php
endif;
?>
<div>
<p>Some static content rendered here</p>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment