0

I want to prevent wordpress from saving the year, month, and day arrays. I use JavaScript to combine the 3 in to one value in the hidden input, therefore I wouldn't need the 3 to store in the database. How would I do that?

$meta_box = array(
    'id' => 'global-releasedate',
    'title' => 'Releasedate',
    'page' => 'films',
    'context' => 'normal',
    'priority' => 'high',
    'fields' => array(
        array(
            'name' => '',
            'id' => $prefix . 'airdate',
            'type' => 'hidden',
            'std' => ''
        ),

        array(
            'name' => 'Year',
            'id' => $prefix . 'year',
            'type' => 'select',
            'options' => $years,
        ),

         array(
            'name' => 'Month',
            'id' => $prefix . 'month',
            'type' => 'select',
            'options' => $months,
        ),

          array(
            'name' => 'Day',
            'id' => $prefix . 'day',
            'type' => 'select',
            'options' => $days,
        ),
    ));
Craig
  • 133
  • 1
  • 13

1 Answers1

0

The solution is actually to remove them or comment them on the functions.php file. If you remove them, they won't get erased from the posts, they will just not be visible for the user anymore, which is what you need.

alesub
  • 1,402
  • 13
  • 14
  • Thank you for your response; however what i'm trying to achieve is leaving the meta field for new post. The thing is, I have 3 select options that I use JavaScript to get their values upon change and store all 3 in one combined value in a hidden input. I wouldn't need each select option after that, hence not saving them to save on database information. I guess letting it store in the database wouldn't be such a bad idea, rather than going through the trouble? – Craig Apr 22 '12 at 17:26
  • I found a solution to my problem by using an if statement around the save/update function – Craig Apr 22 '12 at 20:56