WordPress.org

Make WordPress Core

#45172 closed defect (bug) (fixed)

Custom meta boxes do not show up

Reported by: zodiac1978 Owned by: pento
Milestone: 5.0 Priority: normal
Severity: normal Version: 5.0
Component: Editor Keywords: has-patch, needs-testing, commit, fixed-5.0
Focuses: Cc:
PR Number:

Description

Using the Gutenberg plugin custom meta boxes showed up ( added with add_meta_box() ).

With 5.0-alpha-43818 alone (no Gutenberg plugin active) these custom meta boxes do not show up for me.

You can try this plugin for testing:
https://wordpress.org/plugins/very-simple-event-list/

Attachments (3)

Bildschirmfoto 2018-10-24 um 22.24.12.png (164.6 KB) - added by zodiac1978 14 months ago.
No custom meta boxes with 5.0-alpha-43818
Bildschirmfoto 2018-10-24 um 22.34.32.png (245.7 KB) - added by zodiac1978 14 months ago.
With Gutenberg plugin active the custom meta boxes appear (and an unexptected error message)
45172.diff (17.0 KB) - added by pento 14 months ago.

Download all attachments as: .zip

Change History (18)

@zodiac1978
14 months ago

No custom meta boxes with 5.0-alpha-43818

@zodiac1978
14 months ago

With Gutenberg plugin active the custom meta boxes appear (and an unexptected error message)

#1 @zodiac1978
14 months ago

For the unexpected error message, see #45112

#2 @SergeyBiryukov
14 months ago

  • Milestone changed from Awaiting Review to 5.0

#3 @zodiac1978
14 months ago

After update to 5.0-beta1-43823 still the same problem.

This ticket was mentioned in Slack in #core-editor by swissspidy. View the logs.


14 months ago

#5 @SergeyBiryukov
14 months ago

#45184 was marked as a duplicate.

#6 @mcsf
14 months ago

We suspect this may be caused by the priority (and possibly implementation) of core's wpautop, which differs from the Gutenberg's plugin override gutenberg_wpautop, registered with priority 8.

See GitHub comment in this (generally unrelated) Gutenberg issue.

cc @pento (who will be gracious enough to excuse my constant summoning)

#7 @pento
14 months ago

  • Owner set to pento
  • Status changed from new to assigned

That priority only mattered for the Gutenberg plugin: it was to ensure that wpautop() was removed from the the_content filter, before the function was run. The has_blocks() check is now part of wpautop(), so there's no need to remove it from the filter anymore.

I'll write up a patch to fix this.

@pento
14 months ago

#8 @pento
14 months ago

  • Keywords has-patch needs-testing added

The equivalent of gutenberg_collect_meta_box_data() was missing. Rather than just merge that function it, which is basically a duplicate of a large chunk of edit-format-advanced.php, I moved the common code to a new function, which both edit forms are now able to call.

45172.diff is a first pass at this, it needs testing.

#9 @designsimply
14 months ago

Closed https://github.com/WordPress/gutenberg/issues/11058 as a duplicate but then noticed that that issue mentions wp_add_dashboard_widget() and this issue mentions add_meta_box() and I was wondering if a separate issue should be opened for the one I closed or if it's covered by the work here?

#10 @zodiac1978
14 months ago

@designsimply I think this is handled already in #45112

#11 @designsimply
14 months ago

Thanks @zodiac1978! (updated my link to point to 45112 instead)

#12 @peterwilsoncc
14 months ago

  • Keywords commit added

I've tested 45172.diff with the various callback arguments introduced for 5.0.

  • __block_editor_compatible_meta_box does toggle the display correctly on the new editor. Setting the option to false does not cause the post type to fall back to the classic editor but that can be dealt with on another ticket.
  • __back_compat_meta_box also toggles display correctly.

There are a few coding standards fixes required. As the patch mostyly moves existing code, these can be handled in the 5.1 release.

Last edited 14 months ago by peterwilsoncc (previous) (diff)

#13 @pento
14 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 43837:

Block Editor: Fix meta boxes not showing.

The block editor needs to duplicate the classic meta box behaviour, so it can extract the registered meta boxes, and import them into the block editor.

To match the classic editor behaviour as closely as possible, this moves the relevant code from the classic editor, into a new function, so it can be called by both.

Props pento, peterwilsoncc.
Fixes #45172.

#14 @SergeyBiryukov
13 months ago

  • Keywords fixed-5.0 added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for trunk.

#15 @jeremyfelt
12 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 44214:

Block Editor: Fix meta boxes not showing.

The block editor needs to duplicate the classic meta box behaviour, so it can extract the registered meta boxes, and import them into the block editor.

To match the classic editor behaviour as closely as possible, this moves the relevant code from the classic editor, into a new function, so it can be called by both.

Merges [43837] from the 5.0 branch to trunk.

Props pento, peterwilsoncc.
Fixes #45172.

Note: See TracTickets for help on using tickets.