Skip to main content
1 of 2

How can I properly sanitize the update_option in WordPress?

I am using this part of the code in my WordPress plugin to update the option.

update_option('button_loc_shop_page', $_POST['button_loc_shop_page']);

I want to sanitize the update_option field. How can I properly sanitize it? Any comments or pointers would be really appreciated.