Last active
May 20, 2021 15:01
-
-
Save cstielper/a72ca483319789a25800bd29effed768 to your computer and use it in GitHub Desktop.
Content not rendering after <InnerBlocks />
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 | |
$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