When updating a post meta where the input will be always an integer, should iI use (int)
or is there anya WordPress function for that (eg. sanitize_text_field
)
For?
For example:
if(isset($_POST['category_id'])){
update_post_meta($post->ID, 'category_id', (int)($_POST['category_id']));
}