/**
  * Function to delete players that are stored as an option.
  *
  * @param $ids_to_keep
  *
  * @return bool true if all options deleted, false on failure or non-existent player
  */
 public static function remove_deleted_players($ids_to_keep)
 {
     global $bc_accounts;
     $all_ids_key = '_bc_player_ids_' . $bc_accounts->get_account_id();
     $all_ids = get_option($all_ids_key);
     $all_ids_playlists_key = '_bc_player_playlist_ids_' . $bc_accounts->get_account_id();
     $all_ids_playlists = get_option($all_ids_playlists_key);
     $return_state = true;
     if (is_array($all_ids)) {
         $ids_to_delete = array_diff($all_ids, $ids_to_keep);
         foreach ($ids_to_delete as $id) {
             $key = BC_Utility::get_player_key($id);
             $success = delete_option($key);
             if (!$success) {
                 $return_state = false;
             }
         }
     }
     if (is_array($all_ids_playlists)) {
         foreach ($all_ids_playlists as $id) {
             if (in_array($id, $all_ids_playlists)) {
                 unset($all_ids_playlists[$id]);
             }
         }
     }
     update_option($all_ids_key, $ids_to_keep);
     update_option($all_ids_playlists_key, $all_ids_playlists);
     return $return_state;
 }
 /**
  * Accepts a player ID and checks to see if there is an option in WordPress. Returns the player object on success and false on failure.
  *
  * @param $player_id
  *
  * @return player_object|false
  */
 public function get_player_by_id($player_id)
 {
     $key = BC_Utility::get_player_key($player_id);
     return get_option($key);
 }