- This topic has 10 replies, 3 voices, and was last updated 1 year, 5 months ago by .
-
Topic
-
I’ve created this block:
add_filter('rwmb_meta_boxes', function($meta_boxes) { $meta_boxes[] = [ 'title' => 'Notice', 'id' => 'notice', 'description' => 'A notice block for emphasising spoiler alerts or providing updates', 'type' => 'block', 'icon' => 'megaphone', 'category' => 'layout', 'keywords' => ['spoiler', 'update'], 'render_template' => get_template_directory() . '/functions/custom-blocks/notice.php', 'supports' => [ 'align' => ['wide', 'full'], ], // Block fields. 'fields' => [ [ 'type' => 'select', 'id' => 'type', 'name' => 'Type of notice', 'options' => array( 'spoiler' => 'Spoiler', 'info' => 'Info / Update' ) ], [ 'type' => 'text', 'id' => 'headline', 'name' => 'Headline', ], [ 'type' => 'wysiwyg', 'id' => 'content', 'name' => 'Content', 'raw' => false, 'options' => array( 'textarea_rows' => 4, 'teeny' => true, ), ] ], ]; return $meta_boxes; });
It seems to work fine inside the editor. I’m able to add the block and edit fields. However, after updating the post and then refreshing the page, the inputted data is no longer there. It’s not actually saving the field data.
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- You must be logged in to reply to this topic.