[wp-trac] [WordPress Trac] #51096: Meta boxes hooked on 'edit_form_after_title' don't appear on block-editor page
WordPress Trac
noreply at wordpress.org
Sat Aug 14 01:45:40 UTC 2021
#51096: Meta boxes hooked on 'edit_form_after_title' don't appear on block-editor
page
--------------------------+---------------------
Reporter: apedog | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.9
Component: Editor | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+---------------------
Comment (by costdev):
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
<?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 );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51096#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list