I am trying to make a notification function for a user's account dashboard that displays if they have not added any images to their profile's gallery. I found this page, which is a function that checks if the CURRENT page has any attachments: Check if post/page has gallery?
How can I change that to check by a specific post ID, i.e. a function that will check if post 2 has a gallery or not?