2
votes
2answers
405 views

Prevent empty Post Title on form submit via front end post (wp_insert_post_)

I am creating a post from the front end using (shortened for brevity); if (empty($_POST['my_title'])){ echo 'error: please insert a title'; } else { $title = $_POST['my_title']; } ...
4
votes
1answer
1k views

Does wp_insert_post validate the input?

If I use the wp_insert_post in a plugin, will I have to check the content for SQL injection problems and XSS or will the wp_insert_post function do this for me?