Most campsites frown upon anyone digging holes in the ground, most certainly when they intend to leave some form of waste in the hole! Instead you will want to construct a bin. You will need two types, a wet and dry.
The details of construction have already been covered in the camp gadgets section.
Make sure you replace the bin bag at regular intervals and either store in a place that is out of reach of any person/animal or, ideally, immediately dispose of this rubbish at an appropriate area. Most campsites have proper bins for waste disposal anyhow, but if you are camping in the middle of nowhere, you will either bury your rubbish or take it home with you!