Error thrown

Call to a member function get_gallery_attachment_ids() on boolean