The key function and search key word is add_meta_box()
. This function add additional meta boxes to a post type, also custom post type.
See the codex for more about the parameters and also examples. You find also a lot of examples, how tos in the WWW and here on WPSE.
A simple example to understand it better, but without callback function myplugin_meta_box_callback
, there handle your html, doing inside the meta box.
add_action( 'add_meta_boxes', 'myplugin_add_meta_box' );
/**
* Adds a box to the main column on the Post and Page edit screens.
*/
function myplugin_add_meta_box() {
$screens = array( 'custom_post_type', 'page' );
foreach ( $screens as $screen ) {
add_meta_box(
'myplugin_section_id',
__( 'My Meta Box Title', 'myplugin_textdomain' ),
'myplugin_meta_box_callback',
$screen
);
}
}