I´ve mad a simple Block with one custom field (text). I´ve followed the tutorial, but in Gutenberg the custom field doesnt shows up in Gutenberg.
https://ibb.co/dLVHbZr
https://ibb.co/JxNyH7M
https://ibb.co/C1kSw4B
Here are the codes:
<?php
add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' );
function your_prefix_function_name( $meta_boxes ) {
$prefix = '';
$meta_boxes[] = [
'title' => __( 'zweier', 'your-text-domain' ),
'id' => 'zweier',
'icon' => [
'background' => '',
'foreground' => '#dd3333',
'src' => 'airplane',
],
'category' => 'oxygen-vsb-blocks',
'supports' => [
'align' => [''],
],
'render_code' => '{{ post_id }}
<div class="zweierText">Hier sollte eine Textzeile sein:{{ zweierText }}</div>
',
'type' => 'block',
'context' => 'content',
'fields' => [
[
'name' => __( 'Text', 'your-text-domain' ),
'id' => $prefix . 'zweierText',
'type' => 'text',
'size' => 12,
],
],
];
return $meta_boxes;
}
Render Code:
{{ post_id }}
<div class="zweierText">Hier sollte eine Textzeile sein:{{ zweierText }}</div>
The Post ID renders, as well as the content of the div - expect the {{ zweierText }}