We add a Custom Meta Box and do our thing inside it.
There are some hooks that are not Meta Boxes and we can use to insert content into that admin page:
add_action( 'edit_form_top', function( $post )
{
echo '<h1 style="color:red">edit_form_top</h1>';
});
add_action( 'edit_form_after_title', function( $post )
{
echo '<h1 style="color:red">edit_form_after_title</h1>';
});
add_action( 'edit_form_after_editor', function( $post )
{
echo '<h1 style="color:red">edit_form_after_editor</h1>';
});
add_action( 'edit_page_form', function( $post )
{
// edit_page_form is ONLY for pages, the other is for the rest of post types
echo '<h1 style="color:red">edit_page_form/edit_form_advanced</h1>';
});
add_action( 'dbx_post_sidebar', function( $post )
{
echo '<h1 style="color:red">dbx_post_sidebar</h1>';
});
The widget_text
block belongs to Advanced Custom Fields (it's a repeatable/sortable field). I'm not sure anymore, but I think it removes the Meta Box borders with CSS or jQuery.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…