WordPress.org

Make WordPress Core

Opened 13 months ago

Last modified 6 weeks ago

#51096 new defect (bug)

Meta boxes hooked on 'edit_form_after_title' don't appear on block-editor page

Reported by: apedog Owned by:
Milestone: 5.9 Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: Cc:

Description

The Gutenberg/block-editor page does not print meta boxes hooked on edit_form_advanced action. Meta boxes hooked on edit_form_advanced only show up in classic editor mode.

Block-Editor pages should still print out the meta boxes. Even if they cannot, for technical reason, be printed directly after the title.

I believe this should be viewed as a regression/bug. Not a feature request/enhancement.

Attachments (1)

add_metabox_using_edit_form_after_title.jpg (95.0 KB) - added by costdev 6 weeks ago.
Metabox being printed when hooking edit_form_after_title

Download all attachments as: .zip

Change History (6)

#1 @apedog
13 months ago

  • Summary changed from Meta boxes hooked on 'edit_form_advanced' don't appear on block-editor page to Meta boxes hooked on 'edit_form_after_title' don't appear on block-editor page

That's an unfortunate copy-paste typo.
Hook I'm talking about is edit_form_after_title

I've no idea how edit_form_advanced meta boxes behave on block editor pages.

This ticket was mentioned in Slack in #core by peterwilsoncc. View the logs.


5 months ago

#3 @poena
5 months ago

  • Milestone changed from Awaiting Review to 5.8

Hi
This issue was discussed during a triage session today and it was decided to move it to the 5.8 milestone to get more eyes on it.

When looking for background information about if or why there is no fallback for printing the metaboxes elsewhere, we found this migration guide: https://github.com/danielbachhuber/gutenberg-migration-guide.

#4 @hellofromTonya
4 months ago

  • Milestone changed from 5.8 to 5.9

Today is a freeze for 5.8 as it's Beta 1 day. As investigation is ongoing and there's not a patch yet, punting to 5.9 for resolution.

#5 @costdev
6 weeks ago

Can someone clarity this issue for me?

The following in functions.php shows a metabox at the bottom of the Gutenberg block editor when adding a new post and editing an existing post.

<?php

function add_metabox_using_edit_form_after_title( $post ) {
        add_meta_box(
                'a-meta-box',
                'A Meta Box',
                'render_a_meta_box',
        );
}

function render_a_meta_box( $post ) {
        ?>
        <h1>Hello World!</h1>
        <?php
}

add_action( 'edit_form_after_title', 'add_metabox_using_edit_form_after_title', 10, 1 );

@costdev
6 weeks ago

Metabox being printed when hooking edit_form_after_title

Note: See TracTickets for help on using tickets.