Is sanitize_text_field() is enough to save to DB?

You can use wpdb insert function. It’s better in every way.

It can care about data’s escapeing itself and it’s shorter.

You can use your own query anyway but I would recommended this article for reading https://codex.wordpress.org/Data_Validation#Database

Leave a Comment