I suppose you could compare the Y coordinates of the player and the wall and check if the ceiling is within 10 pixels or however many.
OR! This is probably a better idea. Make a small invisible collision object and Pin it a small distance above the player's head. Then you just have to test if that collision object is overlapping any walls when performing slides.
Both solutions are good, but I would like a mathematical solution, comparing the Y axis of both objects.
I just don't know how to implement it. If anyone knows specifically, I'm very grateful to post here.