I am studying how to write more secure WordPress code by implementing validation, sanitization and data escaping wherever necessary. Validation and escaping makes perfect sense, but I am a little confused about sanitization.
If I use a function like add_post_meta
, does this function do sanitization for me? What about set_option
or other ones that interact with the database. I usually interact with the database via these functions. In which situations do I need to worry about sanitization myself?