Skip to content

Instantly share code, notes, and snippets.

@gmcinnes
Created May 14, 2013 17:10
Show Gist options
  • Save gmcinnes/5577681 to your computer and use it in GitHub Desktop.
Save gmcinnes/5577681 to your computer and use it in GitHub Desktop.
$result = $this->execute("SELECT * FROM wp_postmeta WHERE meta_key LIKE '_meta_box_id_application_date'");
if($result)
{
foreach($result as $row)
{
$type = gettype($row['meta_value']);
switch($type)
case 'string':
$date = date_from_string($row['meta_value']);
$this->execute("UPDATE wp_postmeta SET meta_value = $row['meta_value'] WHERE meta_key = $row['meta_key']")
break;
case 'object': //assuming it's a date?
//whatever you need to do, etc.
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment