/**
  * Attached to 'save_post' hook.
  *
  * Handles options saving for a given app.
  *
  * @param int				$post_id			The app ID.
  */
 public static function save_post($post_id)
 {
     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
         return;
     }
     if (empty($_POST['post_type']) || $_POST['post_type'] != 'wpak_apps') {
         return;
     }
     if (!current_user_can('edit_post', $post_id) && !current_user_can('wpak_edit_apps', $post_id)) {
         return;
     }
     if (!check_admin_referer('wpak-options-' . $post_id, 'wpak-nonce-options')) {
         return;
     }
     if (!empty($_POST['wpak_app_options'])) {
         WpakOptionsStorage::update_options($post_id, $_POST['wpak_app_options']);
     }
 }