admin管理员组文章数量:1391947
I am not able to get the Gutenberg editor in CMB2 (repo). I have follow the comment mentioned on the example file but not working.
I have set the 'mb_callback_args' => [ '__block_editor_compatible_meta_box' => true ]
but doesn't make any difference.
$cmb = new_cmb2_box( [
'id' => 'book_item_meta_box',
'title' => __( 'Book Data Section', 'booker' ),
'object_types' => [ 'book', ],
'context' => 'normal',
'priority' => 'high',
'show_names' => true,
'mb_callback_args' => [ '__block_editor_compatible_meta_box' => true ],
] );
Any help please?
I am not able to get the Gutenberg editor in CMB2 (repo). I have follow the comment mentioned on the example file but not working.
I have set the 'mb_callback_args' => [ '__block_editor_compatible_meta_box' => true ]
but doesn't make any difference.
$cmb = new_cmb2_box( [
'id' => 'book_item_meta_box',
'title' => __( 'Book Data Section', 'booker' ),
'object_types' => [ 'book', ],
'context' => 'normal',
'priority' => 'high',
'show_names' => true,
'mb_callback_args' => [ '__block_editor_compatible_meta_box' => true ],
] );
Any help please?
Share Improve this question asked Feb 13, 2019 at 7:43 pixelngrainpixelngrain 1,3901 gold badge23 silver badges50 bronze badges 4 |1 Answer
Reset to default 1This is, at least at the moment, not possible. You can use CMB2 Meta Boxes in Gutenberg Post Types, but you can not make a CMB2 Field where you can use Gutenberg - as of now.
However, as the Gutenberg Editor is developed further, a CMB2 Block-Editor-Field is not that far. As of now, you can already integrate the Block Editor on your own admin page (see https://github/getdave/standalone-block-editor for instance).
So, if you only need a settings page with a Block Editor, you could use this. You could also try and implement this code into a custom CMB2 Field (I'm not sure this is possible at the moment).
Happy Coding!
本文标签: metaboxHow to use Gutenberg in CMB2
版权声明:本文标题:metabox - How to use Gutenberg in CMB2? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744676698a2619154.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
WYSIWYG
but I am trying to useGutenberg
instead. I have read their docs and try to get it but nothing works. – pixelngrain Commented Feb 14, 2019 at 6:44Gutenberg
editor in custom metabox? – pixelngrain Commented Feb 14, 2019 at 7:07