public function to_json($load)
{
$field_data = parent::to_json($load);
if (!empty($field_data['value'])) {
$value = array();
$field_data['value'] = maybe_unserialize($field_data['value']);
foreach ($field_data['value'] as $single_value) {
$post_type = get_post_type($single_value);
$value[] = array('id' => $single_value, 'title' => $this->get_title_by_type($single_value, 'post', $post_type), 'type' => 'post', 'subtype' => $post_type, 'label' => $this->get_item_label($single_value, 'post', $post_type), 'is_trashed' => get_post_status($single_value) == 'trash');
}
$field_data['value'] = $value;
}
$field_data = array_merge($field_data, array('options' => $this->get_options(), 'max' => $this->max, 'allow_duplicates' => $this->allow_duplicates));
return $field_data;
}