add custom metabox to media library custom widget September 12, 2022 by Tarik Billa It looks that a reference to global $post; is missing at the beginning of your function widget(){}