public function update_post_type($data){
    global $wpdb;

    // escape all the strings
    array_walk_recursive($data, array($this, 'escape_data'));

    $sql = $wpdb->prepare(
      "Update " . MF_TABLE_POSTTYPES .
      " SET type = %s, name = %s, description = %s, arguments = %s " .
      " WHERE id = %d",
      $data['core']['type'],
      $data['core']['label'],
      $data['core']['description'],
      serialize($data),
      $data['core']['id']
    );

    $wpdb->query($sql);
  }