backport https://github.com/tommcfarlin/WordPress-Widget-Boilerplate/commit/90b9ce9b99cf9e88e2e6f09073d7b3c6e2fd1ce8