$portfolioextrafields_1_metabox = array(
'id' => 'portfolioextrafields',
'title' => 'Portfolio Extra Fields',
'page' => array('portfolio'),
'context' => 'normal',
'priority' => 'high',
'fields' => array(
array(
'name' => 'Employee Name',
'desc' => 'Enter the name of the employee',
'id' => 'nick_empname',
'class' => 'nick_empname',
'type' => 'text',
'rich_editor' => 0,
'max' => 0 ),
array(
'name' => 'Employee Lines',
'desc' => 'Enter the lines separated by
',
'id' => 'nick_empline',
'class' => 'nick_empline',
'type' => 'text',
'rich_editor' => 0,
'max' => 0 ),
)
);
add_action('admin_menu', 'nick_add_portfolioextrafields_1_meta_box');
function nick_add_portfolioextrafields_1_meta_box() {
global $portfolioextrafields_1_metabox;
foreach($portfolioextrafields_1_metabox['page'] as $page) {
add_meta_box($portfolioextrafields_1_metabox['id'], $portfolioextrafields_1_metabox['title'], 'nick_show_portfolioextrafields_1_box', $page, 'normal', 'high', $portfolioextrafields_1_metabox);
}
}
// function to show meta boxes
function nick_show_portfolioextrafields_1_box() {
global $post;
global $portfolioextrafields_1_metabox;
global $nick_prefix;
global $wp_version;
// Use nonce for verification
echo '';
echo '
', ' | ';
switch ($field['type']) {
case 'text':
if (!isset($field['std'])) {$ttemp_string = "";} else {$ttemp_string = $field['std'];}
echo ' ', '', stripslashes($field['desc']); break; } echo ' | ', ' |
---|