Custom meta box for pages

Posted: December 24, 2014 in WordPress

add_action( 'admin_init', 'wpl_meta_boxes' );

function wpl_meta_boxes() {
/*-----------------------------------------------------------
Custom meta box for pages
-----------------------------------------------------------*/

$page_meta_box = array(
'id' => 'page_meta_box',
'title' => 'Page Options',
'desc' => '',
'pages' => array( 'page' ),
'context' => 'normal',
'priority' => 'high',
'fields' => array(
array(
'label' => 'Header image',
'id' => 'wpl_header_image',
'type' => 'upload',
'desc' => 'The image will be displayed in the header of the page, the required dimensions: (1680 x 275)',
'std' => '',
'rows' => '',
'post_type' => '',
'taxonomy' => '',
'class' => '',
'section' => ''
),

array(
'label' => 'Name',
'id' => 'wpl_sname',
'type' => 'text',
'desc' => 'Enter your name',
'std' => '',
'rows' => '',
'post_type' => '',
'taxonomy' => '',
'class' => '',
'section' => ''
)

)
);
ot_register_meta_box( $page_meta_box );
}
Advertisements

Comments are closed.