Note that the current implementation does not return the old hook function. This means that there is no way to restore an old hook once you overwrote it.