I'm trying to make a theme options page, it is working, but
I'm not sure on how to sanitize the input properly.
There is a checkbox that lets users choose wether to display a twitter link and icon in the header, and then there is a text field where they put the twitter link.
I am sanitizing the checkbox by intval only,
register_setting( 'Pia-settings-group', 'Pia_twitter_option','intval' ); /*icon and link in header*/
as in this example;
Is this correct?
But how do I sanitize the twitter url?
I need to make sure that is not empty and that it is a proper twitter link, and if it isnt, it has to reset the checkbox aswell, or an icon but no link will be dispalyed in the theme.
and alot of url validation / preg_match tips, but I can't put it together.
It's not do or die but i'd like to learn.