This is not going to be easy to unit test, because we load all functions in unit tests. (We *could* create a group of frontend tests that run first.) That said, we should work into our workflows to test wp_editor() and all related media stuff on the frontend.

This was originally fixed in [22497] and obviously [22821] required one last function in the mix.