Skip to content

Instantly share code, notes, and snippets.

@joshualynch
Created September 26, 2011 19:23
Show Gist options
  • Save joshualynch/1243132 to your computer and use it in GitHub Desktop.
Save joshualynch/1243132 to your computer and use it in GitHub Desktop.
if(count($this->boxes) > 0) {
foreach($this->boxes as $box) {
$data = $_POST[$box['id']];
if($box['type'] == 'editor') {
$data = wptexturize(wpautop($data));
}
if($box['type'] == 'checkbox') {
if($data != 'true') {
$data = 'false';
}
}
if($box['type'] == 'slider') {
if(strpos($data, '-') !== false) {
$data = explode('-',$data);
}
}
if($box['type'] == 'date') {
$date = explode('/', $data);
if(isset($date[2])) $data = mktime(0,0,0,$date[0],$date[1],$date[2]);
}
update_post_meta($post_id, $box['id'], $data);
}
}
Warning: Invalid argument supplied for foreach() in /home/joshual1/public_html/wp-content/themes/project-plan/uielement.class.php on line 388
Warning: Invalid argument supplied for foreach() in /home/joshual1/public_html/wp-content/themes/project-plan/uielement.class.php on line 388
Warning: Cannot modify header information - headers already sent by (output started at /home/joshual1/public_html/wp-content/themes/project-plan/uielement.class.php:388) in /home/joshual1/public_html/wp-includes/pluggable.php on line 934
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment