Created
May 14, 2013 17:10
-
-
Save gmcinnes/5577681 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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