ID,'aa_page_meta',TRUE); if (isset($meta['show'])){$show = $meta['show'];} if (isset($meta['vshow'])){$vshow = $meta['vshow'];} if (isset($meta['fshow'])){$fshow = $meta['fshow'];} if (isset($meta['ashow'])){$ashow = $meta['ashow'];} if (isset($meta['gshow'])){$gshow = $meta['gshow'];} ?>
/>
Video Area Hidden Permanently','autoa');} if ($opts['hideaudioall'] == 'no'){?>
Audio Area Hidden Permanently','autoa');} if($opts['galeri'] == 'yes' ) {?>
Gallery Hidden Permanently','autoa');} if ($opts['hidefilesall'] == 'no'){?>
Files Area Hidden Permanently','autoa');} // create a custom nonce for submit verification later echo ''; } function aa_meta_post() { global $post; //Get Plugin Options for good use :) $opts = get_option('auto_attachments_options'); // using an underscore, prevents the meta variable // from showing up in the custom fields section $meta = get_post_meta($post->ID,'aa_post_meta',TRUE); if (isset($meta['where'])){$where = $meta['where'];} if (isset($meta['vshow'])){$vshow = $meta['vshow'];} if (isset($meta['fshow'])){$fshow = $meta['fshow'];} if (isset($meta['ashow'])){$ashow = $meta['ashow'];} if (isset($meta['gshow'])){$gshow = $meta['gshow'];} ?>
Video Area Hidden Permanently','autoa');} if ($opts['hideaudioall'] == 'no'){?>
Audio Area Hidden Permanently','autoa');} if($opts['galeri'] == 'yes' ) {?>
Gallery Hidden Permanently','autoa');} if ($opts['hidefilesall'] == 'no'){?>
Files Area Hidden Permanently','autoa');} // create a custom nonce for submit verification later echo ''; } function aa_meta_save($post_id) { // authentication checks // make sure data came from our meta box if (!wp_verify_nonce($_POST['my_meta_noncename'],__FILE__)) return $post_id; // check user permissions if ($_POST['post_type'] == 'page') { if (!current_user_can('edit_page', $post_id)) return $post_id; $current_data = get_post_meta($post_id, 'aa_page_meta', TRUE); $new_data = $_POST['aa_page_meta']; my_meta_clean($new_data); if ($current_data) { if (is_null($new_data)) delete_post_meta($post_id,'aa_page_meta'); else update_post_meta($post_id,'aa_page_meta',$new_data); } elseif (!is_null($new_data)) { add_post_meta($post_id,'aa_page_meta',$new_data,TRUE); } return $post_id; } elseif($_POST['post_type'] == 'post') { if (!current_user_can('edit_post', $post_id)) return $post_id; $current_data = get_post_meta($post_id, 'aa_post_meta', TRUE); $new_data = $_POST['aa_post_meta']; my_meta_clean($new_data); if ($current_data) { if (is_null($new_data)) delete_post_meta($post_id,'aa_post_meta'); else update_post_meta($post_id,'aa_post_meta',$new_data); } elseif (!is_null($new_data)) { add_post_meta($post_id,'aa_post_meta',$new_data,TRUE); } return $post_id; } } function my_meta_clean(&$arr) { if (is_array($arr)) { foreach ($arr as $i => $v) { if (is_array($arr[$i])) { my_meta_clean($arr[$i]); if (!count($arr[$i])) { unset($arr[$i]); } } else { if (trim($arr[$i]) == '') { unset($arr[$i]); } } } if (!count($arr)) { $arr = NULL; } } } ?>