public function parse(&$postdata)
{
# Use the parent parse
$ret =& parent::parse($postdata);
# gonna pick a case
if (!empty($ret['ID'])) {
$ret['id'] =& $ret['ID'];
unset($ret['ID']);
}
# Take only the fields we need, put them in a temp array
# TODO: current_blog may not be correct
$ret['blogid'] = get_current_blog_id();
# Fill up the meta attribute with post meta
$ret['post_meta'] = array();
$meta_keys = get_post_custom_keys($ret['id']);
if (is_array($meta_keys)) {
foreach ($meta_keys as $key) {
$ret['post_meta'][$key] = get_post_meta($ret['id'], $key, true);
}
}
if ($ret['post_type'] == 'post') {
$ret['post_format'] = get_post_format($ret['id']);
}
return $ret;
}