Get post ID in post/page edit area July 12, 2022 by Tarik Billa Try using $_POST[‘post_id’] in the upload area as file.php does not include the global $post object.