I've searched for this issue quite a bit and only found solutiosn 1+ years old. I'm not confident using those with the latest wordpress version.
I'm developing a plugin in which a users needs to input a url to an image. It would be better to also have a button next to it to let the user select an image (or other file) from the media library. How can I code this in a plugin?