MetaBox fields not showing in Gutenberg Editor

Support General MetaBox fields not showing in Gutenberg EditorResolved

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #32619
    Michele SchembriMichele Schembri
    Participant

    I 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'),

    #32641
    Long NguyenLong Nguyen
    Moderator

    Hi Michele,

    It might relate to the setting context of 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/#contexts

    #32649
    Michele SchembriMichele Schembri
    Participant

    Hi, thanks for this, changing the context to 'normal' seems to have done the trick.

    #37024
    eric@reformedmedia.com[email protected]
    Participant

    Hi 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!

    #37044
    Long NguyenLong Nguyen
    Moderator

    Hi Eric,

    If you are using the code to create the meta box and custom fields, please find the context setting 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

    #46228

    Hi, 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.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.