Allow callback to be set by options array, inspired by bug 27391