Skip to content

Instantly share code, notes, and snippets.

@cstielper
Last active May 20, 2021 15: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 cstielper/a72ca483319789a25800bd29effed768 to your computer and use it in GitHub Desktop.
Save cstielper/a72ca483319789a25800bd29effed768 to your computer and use it in GitHub Desktop.
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