This extension provides some working examples for hooks in EXT:jh_magnificpopup. Please see documentatio,n documentation of EXT:jh_magnificpopup (Chapter Development) and have a look at the commented code of this extension.