It does seem gross, but yes, human feces can be used to fertilize crops. It's actually still being done, and some experts even recommend it. When wastewater is processed so the remnants can be used, the result is called biosolids.
There are some dangerous things that are in feces, of course, that have to be neutralized before it can be used in a biosolid. One way to accomplish that is by composting, something almost anyone can do, even at home. There are also sterilization procedures, such as those used in sewage treatment.
Using biosolids in agriculture is one way to solve some environmental problems as well. It could help prevent sewage from ending up where it shouldn't, like in streams and lakes, while promoting greener farming practices that decrease runoff. Biosolids are also cheaper to create than fertilizers.