';
// Use nonce for verification
echo '';
// The actual fields for data entry
global $post;
$featured_post_checked = NULL;
$manual_content_checked = NULL;
if(get_post_meta($post->ID, 'evol_featured_post',false)) $featured_post_checked = 'checked=checked';
if(get_post_meta($post->ID, 'evol_manual_content',false)) $manual_content_checked = 'checked=checked';
echo ' ' . __('Display on front page slide?','evol');
echo '
'.__('**Use theme option to control how many image to display.','evol').'
';
echo ' ' . __('Disable auto format','evol');
echo '
' . __('Disable auto content formating, useful if you stay with wordpress post format but full content control.','evol') . '
';
echo '' . __('Extra information for posts.','evol').' ';
echo '' . __('*Fields allow HTML','evol').'';
echo '
';
$td = 0;
global $evol_post_metas; //Defined in functions.php
foreach( $evol_post_metas as $key ) {
$label = $key['label'];
$name = $key['id'];
$value = htmlentities(stripcslashes(get_post_meta($post->ID, $key['id'],true)));
if(!$td % 2) echo '
';
echo '
';
echo '';
echo '
';
echo '
';
echo '';
echo '
';
if($td % 2) echo '
';
$td++;
}
echo '
';
echo '';
}
/* When the post is saved, saves our custom data */
function evol_save_postdata( $post_id ) {
if ( !wp_verify_nonce( $_POST['_evol_nonce'], plugin_basename(__FILE__) )) {
return $post_id;
}
// verify if this is an auto save routine. If it is our form has not been submitted, so we dont want
// to do anything
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
return $post_id;
// Check permissions
if ( 'page' == $_POST['post_type'] ) {
if ( !current_user_can( 'edit_page', $post_id ) )
return $post_id;
} else {
if ( !current_user_can( 'edit_post', $post_id ) )
return $post_id;
}
// OK, we're authenticated: we need to find and save the data
// Sorry, i've no time to make it shorter, maybe later.
$featured_post = $_POST['evol_featured_post'];
if(!empty($featured_post)) {
update_post_meta($post_id, 'evol_featured_post', 'yes');
} else {
delete_post_meta($post_id, 'evol_featured_post');
}
$manual_content = $_POST['evol_manual_content'];
if(!empty($manual_content)) {
update_post_meta($post_id, 'evol_manual_content', 'yes');
} else {
delete_post_meta($post_id, 'evol_manual_content');
}
global $evol_post_metas, $post;
foreach( $evol_post_metas as $key ) {
$name = $key['id'];
$data = $_POST[$name];
if(!empty($data)) {
$data = addslashes(trim(($data)));
update_post_meta($post_id, $name, $data);
} else {
delete_post_meta($post_id, $name);
}
}
return $data;
return $featured_post;
return $manual_content;
}
?>