We finally updated to Gutenberg editor and found out (with surprise) that metabox.io custom fields aren't showing for Author and Editor roles. Only Administrator can see them. What are we doing wrong?
All metabox.io extensions are updated to latest versions
Hi, do you use any conditions for meta box or fields?
I've just tested with Gutenberg and Contributor role and it seems to be fine. Here is my screenshot:
We use this code to display fields
[ 'title' => 'Поля обзоров матчей', 'post_types' => 'post', 'include' => array ( 'category' => [ self::$category_id ], ), 'fields' => [ [ 'name' => 'Состав команды 1', 'type' => 'WYSIWYG', 'id' => 'team_1_players', 'options' => [ 'textarea_rows' => 4, 'teeny'=> true,'media_buttons' => false, 'raw' => false,], ], [ 'name' => 'Состав команды 2', 'type' => 'WYSIWYG', 'id' => 'team_2_players', 'options' => [ 'textarea_rows' => 4, 'teeny' => true, 'media_buttons' => false, 'raw' => false,] ], [ 'name' => 'Прогноз на матч', 'type' => 'WYSIWYG', 'id' => 'game_result_tip', 'options' => [ 'textarea_rows' => 5, 'teeny' => true, 'media_buttons' => false, 'raw' => false,] ], [ 'name' => 'Матч', 'type' => 'post', 'id' => 'event_id', 'post_type' => 'event', ], ], ]
I see you use a condition for the meta box. So the post must in a specific category before the meta box appear. Don't forget to refresh the page after publishing. See my video here: http://recordit.co/ukE4SLIQaD
I thought so too, but it only appears for Administrator roles after refreshing the page. Authors, Editors, etc - everybody else can't see it. That is strange but it is so.
By the way - any ideas how to make fields appear at once, without refreshing the page? It was like that with classic editor. You choose a category and new fields appear.
Gutenberg submits posts via Ajax, but the Include Exclude extension that you're using uses PHP to filter the meta boxes. So, it needs refreshing the page.
To make it work without refreshing the page, I'd suggest using Conditional Logic. However, it doesn't work with WordPress's category box yet.
Thanks for the quick reply, unfortunately it did not help.
After a lengthy search, it turned out that the user had strange meta in the user_meta table.
Like 'closedpostboxes_post','metaboxhidden_post','meta-boxorder_event', 'closedpostboxes_event', 'metaboxhidden_event', 'meta-box-order_post'
Am delete it and now everything work fine
mb you know what is?
Oh, I got it. These user meta are used by WP to store meta boxes state (visible/hidden) and their order (users can reorder). Looks like Gutenberg doesn't handle these settings properly.
Yes, you can remove them without any problem. Meta Box won't be affected by that.
That did the trick!
Everything's working fine now, thank you