Metabox is the graphic container of our custom fields. It will appear as a fieldsets in the admin page, containing our custom fields.
add_action('add_meta_boxes_{post_type_name}','add_metabox_function');
function add_metabox_function($post)
{
add_meta_box('id','title','metabox_field_function','post_type_name','normal','default');
}
This function will contain all necessary html, CSS and logical code to manage and show our custom fields.
function metabox_field_function()
{
//html code to show fields and php code to manage fields
}
One interesting thing is that you don’t have to define an html form and a submit button, because your code will be automatically wrapped in.
So: no form and no submit butto, but the normal html input tag.