MetaBox fields not showing in Gutenberg Editor
- This topic has 5 replies, 4 voices, and was last updated 1 year, 2 months ago by
Oscar Domingo Mateo Oro.
-
AuthorPosts
-
December 15, 2021 at 2:25 AM #32619
Michele Schembri
ParticipantI am currently working on a project and using the default WordPress Editor I could see the custom fields I was defining. I later decided to enable Gutenberg Editor as this is needed, however the custom fields I defined are no longer showing. I also went to Gutenberg Editor > Preferences > Panels > Toggled Custom Fields, however after saving and opening these preferences again, it seems that the option was not saved.
If it helps, I have the following supports when defining the CPT:
'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'revisions'),December 15, 2021 at 12:50 PM #32641Long Nguyen
ModeratorHi Michele,
It might relate to the setting
contextof the meta box. If you use the Block Editor (Gutenberg), please set it to normal. Refer to this documentation https://docs.metabox.io/creating-meta-boxes/#contextsDecember 15, 2021 at 3:04 PM #32649Michele Schembri
ParticipantHi, thanks for this, changing the context to 'normal' seems to have done the trick.
July 15, 2022 at 7:13 PM #37024[email protected]
ParticipantHi Long,
I looked over the documentation you suggested.
I'm having a similar issue. Mine is a simple subtitle that I added to a page. In the old editor it shows, but in Gutenberg it disappeared.
I created a plugin using MB so the original design is gone and is just the code now in the plugin.
How do I find the context setting? Should that be in the code I already have for the plugin?
Is this done using Views? I'm a little confused. Thanks!
July 17, 2022 at 9:43 PM #37044Long Nguyen
ModeratorHi Eric,
If you are using the code to create the meta box and custom fields, please find the
contextsetting under meta box settings.add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $meta_boxes[] = [ 'title' => __( 'Post Meta', 'your-text-domain' ), 'id' => 'post-meta', 'context' => 'side', //here 'fields' => [ ... ], ]; return $meta_boxes; }Read more on the documentation https://docs.metabox.io/creating-fields-with-code/#field-group-settings
August 24, 2024 at 5:28 PM #46228Oscar Domingo Mateo Oro
ParticipantHi, I'm having this issue, MB fields are missing from Gutenberg editor.
The "context" options seems to no longer be in the field group configuration. Now there's "Position" with "after content" or "side", but none of them works.
I activated "Custom Fields" in Gutenberg preferences, and reloaded. -
AuthorPosts
- You must be logged in to reply to this topic.