I have written a Wordpress php template to take user input via a HTML form. The information in the form is used to create a new (draft) post. I have escaped all the input using.
esc_html($_POST['name']);
I also check user input is present before submit. How do I protect against sql injection? Are there another precautions I should take.